> Please don't call startActivity() from an IntentReceiver.  This will
> pop your activity up in front of whatever they are doing, and they
> will likely curse you loudly.

This could be an intended function, only if the user decides "this is
the behavior I would like" but not necessarily the default behavior.

On that same note, how can you use the Android API to find out whether
or not your application is currently the top-level application (ie. if
it's running or not?)  I would like to have the ability to bring it to
life if a critical ... "something"... happens, or show a
NotificationMessage on other instances, like GTALK does.

> Another approach you can take which may be much cleaner is to have a
> single activity that watches the phone state and just updates itself
> in response to that.  This update could either be in the form of
> changing what it is displaying (such as by calling setContentView()
> with the desired layout to display), or it could be an ActivityGroup
> that switches between embedded activities based on the state.

Actually, an activity group is not a bad idea.  I have solved it by
embedding a registered receiver inside the main application and
applying it so that I can use "broadcastIntent" with its special
identifier to bring it to life.  From this point, I am able to start a
sub activity.  I will be posting the code soon.

Either way, I am asking for the "right" way to switch application
screens from either Activity classes or IntentReceiver classes, but it
seems the "best" way to do it - at least right now - is to broadcast
an intent and allow the activity to respond to it.  That's the
behavior I am seeing.

Thank you for the help so far!
-- Kenji
--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to