diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 68d785a..6927407 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,6 +12,11 @@ + + + + + +// * See the Android Training lesson Communicating with Other Fragments for more information. +// */ +// public interface OnFragmentInteractionListener { +// // TODO: Update argument type and name +// void onFragmentInteraction(Uri uri); +// } + + + + + private View.OnClickListener cameraBtnListener = new View.OnClickListener() + { + + public void onClick(View v) + { + + Log.d(TAG, "in camera Button"); + Intent intent = new Intent("android.media.action.IMAGE_CAPTURE"); + startActivityForResult(intent, REQUEST_IMAGE_CAPTURE); + + } + + }; + + + @Override + public void onActivityResult(int requestCode, int resultCode, Intent data) { + Log.d(TAG, "on activity result"); + Log.d(TAG, "requestCode: "+requestCode); + Log.d(TAG, "resultCode: "+resultCode); + Log.d(TAG, "Activity.RESULT_OK: "+Activity.RESULT_OK); + if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == Activity.RESULT_OK) { + Log.d(TAG, "inside if"); + + Bundle extras = data.getExtras(); + Bitmap imageBitmap= (Bitmap) extras.get("data"); + Log.d(TAG, "bitmap: "+imageBitmap.toString()); + +// Bitmap imageBitmap = (Bitmap) extras.get("data"); + avatarImage.setImageBitmap(imageBitmap); + } + } + + +} diff --git a/app/src/main/res/layout/fragment_settings.xml b/app/src/main/res/layout/fragment_settings.xml new file mode 100644 index 0000000..799fe50 --- /dev/null +++ b/app/src/main/res/layout/fragment_settings.xml @@ -0,0 +1,20 @@ + + + +