In my android app I employ a camera activity which sometimes works and sometimes doesn\'t. About 30% of the time the uri set up to store the photo comes back with a null va
Thanks to CommonsWare I resolved the issue by implementing a onSaveInstance State. This should be required information on any android camera documentation as you lose the global variables whenever you change the camera's orientation.
@Override
public void onSaveInstanceState(Bundle savedInstanceState) {
// Save the user's current game state
savedInstanceState.putParcelable("myURI", imageUri);
// Always call the superclass so it can save the view hierarchy state
super.onSaveInstanceState(savedInstanceState);
}
public void onRestoreInstanceState(Bundle savedInstanceState) {
// Always call the superclass so it can restore the view hierarchy
super.onRestoreInstanceState(savedInstanceState);
// Restore state members from saved instance
imageUri = savedInstanceState.getParcelable("myURI");
}