when i start Camera
intent, i noticed onActivityResult
is called before onResume
in fragment
lifecycle.
I also noticed onActivityResult
is called after onStart
.
But here's the strange part: i have variable fileUri == "some image path". This variable is
- NOT NULL in onStart.
- NULL in onActivityResult
- NOT NULL again in onResume
see logCat
12-03 14:39:42.418: D/Fragment1(29220): onStart fileUri: file:///mnt/sdcard/OPS_IMAGES/IMG_20121203_143933.jpg
12-03 14:39:42.463: W/PhoneWindow(29220): Previously focused view reported id 2131034140 during save, but can't be found during restore.
12-03 14:39:42.463: D/Fragment1(29220): onActivityResult fileUri is NULL!!!
12-03 14:39:42.468: D/Fragment1(29220): onResume fileUri: file:///mnt/sdcard/OPS_IMAGES/IMG_20121203_143933.jpg
Worst part is, this only happens 50% of the time. Another 50% onActivityResult can access fileUri value without problem...
How am i supposed to debug this?
NOTE: For the sake of simplicity, i didnt include code of my onResume, onStart, onActivityResult methods. They are just basic methods with variable check and log call. If needed, i will edit question and add these methods.
NOTE2: i am using google support library to support fragments on older API versions.