KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have an app published and one of the fundamental features is to allow the user to take a picture, and then save that photo in a specific folder on their External Storage. Everything seems to be working fine, but I've gotten two reports now that claim that after taking a photo, and clicking "Done" to exit the camera (and return back to the Activity), the app is Forced Closed, bringing the user back to the home screen. This happens on a Samsung Nexus S and the Galaxy Tab. Below I've posted my code to show I set up my intent and how I handle saving and displaying the photo in onActivityResult(). Any guidance on what might be causing it to crash after they click "Done" to exit the camera app, would be greatly appreciated! Again, this seems to be working fine on most devices but I was wondering if their is a more efficient, universal approach I should be taking. Thank you How I'm firing the Camera Intent case ACTION_BAR_CAMERA: // numbered image name fileName = "image_" + String.valueOf(numImages) + ".jpg"; output = new File(direct + File.separator + fileName); // create // output while (output.exists()) { // while the file exists numImages++; // increment number of images fileName = "image_" + String.valueOf(numImages) + ".jpg"; output = new File(outputFolder, fileName); } camera = new Intent(android.provider.MediaStore.ACTION_IMAGE_CAPTURE); uriSavedImage = Uri.fromFile(output); // get Uri of the output camera.putExtra(MediaStore.EXTRA_OUTPUT, uriSavedImage); //pass in Uri to camera intent startActivityForResult(camera, 1); break; default: return super.onHandleActionBarItemClick(item, position); } return true; } How I'm setting up onActivityResult() @Override protected
Tags (comma-separated)
Save Edits
Cancel