thanks for the response.

i implemented by own affinity-defeat, by calling finish() in onPause() :-)

but i will check out an affinity-based solution just to learn how. 
it's no problem that users can't get back to that activity, because 
it's only supposed to be accessible when the phone rings.



>This is because of task affinities:
>
><http://developer.android.com/guide/topics/fundamentals.html#acttask>http://developer.android.com/guide/topics/fundamentals.html#acttask
>
>The easy solution is to give this activity an empty affinity, so it 
>is not considered to be part of your application.  But when you do 
>this, you do need to think about how the user will leave the 
>activity -- this is only a problem if the activity has been left 
>running (or at least an entry for it in the stack of your process 
>got killed at some point).  If you give it its own affinity, the 
>user can't return to it from your main app, so you probably want to 
>make sure you are managing it some way.  Though if there is just 
>that one, it isn't the end of the world if it gets left around to be 
>shown each time there is a call or whatever.
>
>I think this really boils down to the same kind of activity task 
>management that one needs to do with notifications, and there are a 
>number of approaches you can take there depending on the semantics 
>you want.
>
>On Mon, Sep 14, 2009 at 2:37 PM, Jason Proctor 
><<mailto:jason.android.li...@gmail.com>jason.android.li...@gmail.com> 
>wrote:
>
>
>hey i was hoping for some guidance on an intent issue.
>
>my app has three main components -- a regular main/launch one which
>handles most of the functionality, a broadcast receiver which listens
>for phone state, and a view activity which shows stuff when the phone
>rings.
>
>the phone rings, the broadcast receiver picks up, makes a network
>call, launches the view activity to do its thing. then the caller
>hangs up. the local user then hits the home button.
>
>ok so far. but here's the problem - when the user hits the
>application icon to come back in, the system displays the view-only
>activity, not the "main" one.
>
>huh? i thought the system would pick the main/launch one, as only
>those are registered to appear on the home page. seems like it's
>confused about which activity is which.
>
>currently i declare the activity as action VIEW with no category. i
>invoke it by class name, so there's no doubt which one i'll get. is
>there a way to declare the view activity so that it will most
>definitely not be the one the system picks to handle a click on the
>home page? i suppose i could trap keydown, check for Home, then
>finish(), but seems like there should be a more elegant way.
>
>thanks much
>--
>jason.vp.engineering.particle
>
>
>
>
>--
>Dianne Hackborn
>Android framework engineer
><mailto:hack...@android.com>hack...@android.com
>
>Note: please don't send private questions to me, as I don't have 
>time to provide private support, and so won't reply to such e-mails. 
> All such questions should be posted on public forums, where I and 
>others can see and answer them.
>
>
>

-- 
jason.vp.engineering.particle

--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to