Reputation: 1
I had a code for taking photos and displaying them on map previously. Even i didn' t change the code related with that part, it doesn't work after installing android 2.3.6. I debugged the code and the code does not go into onActivityResult method. I could not debug the software in other versions rigth now. Can any one help me about the problem. Related code is given below:
protected void startCameraActivity() {
File fileDirectory = new File(Environment.getExternalStorageDirectory()+ filePath);
// have the object build the directory structure, if needed.
fileDirectory.mkdirs();
imageNumber++;
File file = new File(fileDirectory, "image_" + imageNumber
+ ".jpg");
if (file.exists()) file.delete();
Uri outputFileUri = Uri.fromFile(file);
imagePath = file.toString();
Intent intent = new Intent(
android.provider.MediaStore.ACTION_IMAGE_CAPTURE);
intent.putExtra(MediaStore.EXTRA_OUTPUT, outputFileUri);
startActivityForResult(intent, 0);
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
switch (resultCode) {
case -1:
// this code performs operations about the saved image file
new LongOperation().execute("");
break;
}
switch (requestCode) {
case 3:
enableGPS();
break;
}
}
Upvotes: 0
Views: 2037
Reputation: 629
After some research I fond a solution: The problem with an external camera in Android using MediaStore.ACTION_IMAGE_CAPTURE
Upvotes: 0
Reputation: 2562
Add this line in onActivityResult()
super.onActivityResult(requestCode, resultCode, data);
Upvotes: 2