Look at your logcat. It tells you when an activity hasn't started. 
For the onActivityResult getting called instantly: Your returning activity 
was probably started with a singleTask or singleInstance. This means that 
onActivityResult was called immediately after your activity was started 
(and not upon its return). Use default/standard instead.

On Friday, March 29, 2013 4:16:53 PM UTC-4, plnelson wrote:
>
> Over many projects I've run into various problems with Activities doing 
> mysterious things.   I've had them not start; I've had onActivityResult not 
> get called when I'm trying to send parameters back from an Activity; I've 
> had onActivityResult get called *instantly* before the other Activity 
> even got created.    Googling the web I see that lots of people have these 
> problems and often these either stump people on StackOverflow or result in 
> random "superstitious" fixes with no obvious basis - even if they sometimes 
> seem to work.
>  
> So* My Question*:  is there any *systematic* way to debug Activity 
> life-cycle problems - are there log files, traces, dumps, or anything that 
> programmers can use to figure out why something is happening.    If I call 
> "startActivity" and the activity is never created or started, is there 
> anyplace Android tells us why?   If onActivityResult is called prematurely 
> (i.e., before the Activity that's supposed to return the result even 
> exists) how can we find out why it was called?     Are there any hints of 
> tricks to interpreting the call stack that can shed light on that?
>
> Thanks in advance for any tips or tricks.
>
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to