Reputation: 41
I have a fragment. From this fragment I show a dialogfragment. From this dialog fragment I call to camera intent with startactivityforresult. Okay, the problem is:
Sometimes, when finish the camera intent, it call onActivityResult of dialogfragment and it's okay, but, sometime when finish the camera intent, it call onCreateView of the fragment. And after it call to onCreateView of the dialog fragment, and after it call onActivityResult of the dialogFragment. The proble is that I have a path of the picture in the dialogfragment and when the camera intent is finished and it called directly to onCreate view, work good, because the path is not null. But when the camera intent is finished, and after it call to onCrateView of the fragment and oncreateView of the dialogfragment when it go to the onActivity result, doesn't work because the path of the image is null...
Do you know why it is?
Sorry for my English.
Thanks you!!
Upvotes: 0
Views: 176
Reputation: 41
The problem was that the system destroyed the activity. I have saved a path in a variable in method onSaveInstanceState.
Upvotes: 0