[android-developers] Re: Explicit intents
Thankyou for your reply. Thankyou also for answering the last question
I posted to this forum, and thankyou for writing the best book I have
on on Android programming.
I have an app in the Market which is going very well indeed, but I am
having lots of trouble taking it to the next level.
Lets say I have an Activity on top of the stack. It passes an intent
to another of my apps but doesn't finalise, and the new app is now on
top of the stack. It sends an intent back to the original application.
This must cause some method to be be run in the original application.
I was expecting an explicit handler to be invoked; this is how the
system notifies apps that UI events have occurred, which seems the
same sort of thing. An "onIntentReceived" method, like an
"onButtonClick" method. I note that there is an "onNewIntent" method,
but it has limitted applicability, and doesn't seem that commonly
used.
If the original app was not finalised, OnCreate will not be run again,
so I can't depend on that. I note there is an onResume method, I
assume this is always run when an existing app is moved to the top of
the stack. So I could put getIntent() statements in both OnCreate and
OnResume methods. This seems wrong, and isn't how the demos generally
work.
An intent is passed to a Class, and not to a method. What method is
actually run when a new intent is received? Where can I reliably put
my getIntent() logic to work out what my app really has to do? In
onResume and OnCreate, or in onRestart or in onNewIntent? Or in some
other manner? I want to centralise my intent handling logic, but don't
know the simplest/most reliable method to put it in. Can you make any
suggestions?
Do these questions at least make sense to you?
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home