Thursday, April 26, 2012

[android-developers] Re: Handling remote control buttons


Thanks, that certainly resolves hours of trying to resolve this issue.

I had used singleTask in the past, but I discovered that singleTask ignores incoming Intents when the application is started by other activities.  I have since resolve that problem by having a head-less activity be the designated activity to receive incoming Intents, and leaving the main Activity for status and to load new media from within it.  Because of that, I can apply your advice.  

The use of a head-less Activity for incomming Intents also resoves the problem of having an Intent mysteriously coming back after a screen rotation.  

Thanks

On Thursday, April 26, 2012 5:58:25 PM UTC-4, lbendlin wrote:
set your main activity to android:launchMode="singleTask"   android:alwaysRetainTaskState="true"
and all your other activities to android:noHistory="true" (if applicable)

On Thursday, April 26, 2012 4:09:25 AM UTC-4, Jeremy Villalobos wrote:
Hello:

I followed the advice from this blog to receive the bluetooth buttons for my app:

http://android-developers.blogspot.com/2010/06/allowing-applications-to-play-nicer.html

The buttons work on the average case.  However, if the user opens two instances of my app (one by starting the app, and another through an Intent call like open file, open attashment etc.) now I have two instances running, and they both run the button code.  I get two calls.

I tried limiting the number of instances in the Manifest, but it does no effect ( Tried android:launchMode="singleTop" and "singleInstance" ).  

What is the clean way to get this to work ?

Thanks


--
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


Real Estate