i am trying for month to make simple camera capture with no success. This app i am developing was working great few months ago, but since i update android to version 7 the app stop working correct. I want to click a button, activate the camera (build in not api) after capture to display the image in imageview (in high quality) and save the image to the pictures folder. after that to send the image to server. In the existing version of my app, i was capture the image, display the saved image in the imageview and send to server via json. Now the activity results is null and the imageview is empty :-( Please HELP
Old code that work great for a while
public void onClick(View v) {
switch (v.getId()) {
case R.id.cancel_btn:
finish();
break;
case R.id.camera_btn:
Intent cameraIntent = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
cameraIntent.putExtra(MediaStore.EXTRA_SCREEN_ORIENTATION, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
startActivityForResult(cameraIntent, CAMERA_REQUEST);
break;
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == CAMERA_REQUEST && resultCode == Activity.RESULT_OK) {
Uri u = data.getData();
Log.d("u", String.valueOf(u));
theImageUriStr = String.valueOf(u);
Log.d("theImageUriStr", String.valueOf(theImageUriStr));
mImageView = (ImageView) findViewById(R.id.mImageView);
ALBUM_ART_URI = Uri.parse(String.valueOf(theImageUriStr));
Picasso.with(AddNewDish.this).load(ALBUM_ART_URI).into(mImageView);
}
else{
Log.d("mmmm", String.valueOf(resultCode));
}
}
The result i am getting from Log.d u and theImageUriStr is null