I am trying to take a picture using an intent. My problem is that sometimes after taking a picture my activity, which calls startActivityForResult, seems to be destroyed so
Disable "Don't keep activities" Developer setting. Otherwise it will destroy the activity you are leaving.