Android startCamera gives me null Intent and … does it destroy my global variable?

It’s possible that launching of ACTION_IMAGE_CAPTURE will push your activity out of memory. You should check (I’d simply a log, debugger may have its own side effects) that onCreate() of your activity is called before onActivityResult(). If this is the case, you should prepare your activity to reinitialize itself, probably using onSaveInstanceState(Bundle).

Note that the decision whether to shut down the activity, or keep it in background, depends on the overall system state that is beyond your control. It won’t surprise me if the decision when you take the first picture, is “shut him down!”, but when you take picture again, it is “keep him in background”.

Leave a Comment