by qlimax » Thu, 17 Dec 2009 21:04:04 GMT

Sponsored Links
 Hi guys.

I'm writing an application that use a service to play an audio file

I'm watching the LocalService.java and LocalServiceBinding.java
from the API DEMO

In the api demo, the LocalService.java make a notification in the
status bar, in my case it plays mp3 and make a notification. But that
doesn't matter.

My problem is that when the user press the "Back Button" the service
must stay active.
I want have the same behaviour as  when i press the "Home Button"...

Any help is welcome :D

ps:sorry for my eng



by qlimax » Thu, 17 Dec 2009 22:15:55 GMT

 sorry... maybe solved without binding
but using startService/stopService

----maybe... requires tests :::)))----


Sponsored Links


by G » Thu, 17 Dec 2009 23:03:08 GMT

 Hey I ran into this problem a while back and was pulling my hair out.
The fix is easy (and you're on the right track)

You can still call bindService, you just have to call startService
first. If the service is started via bindService, then it will live
and die with the activity that called it, but if you start it with
startService and THEN bind it with bindService, it should stay alive



by qlimax » Fri, 18 Dec 2009 00:16:43 GMT

 Hi G,
thanks a lot for the explanation.
(souch thigs should be better documented...)



Other Threads

1. Alert Dialog ok button greyed out issue

Hi All,

Does anybody know how to grey out the okay button in  an AlertDialog?



2. Touch Mode and ListViewItems with a Compound View

I have read related posts and blogs about how a list item loses
selection on entering touch mode and the suggestion to use onClick/
onSelect listeners or selection modes, but I am still having the
following problem.

I have a list view,  where  each  item row is a compound view,
consisting of an edit box and a check box.

I want to track the position of the compound view item  on which the
user is working currently  (even if the row is not selected but the
edit box in the compound view has focus).

Currently I am trying to use ListView's onItemClick/OnItemSelect
listeners to track the current item row. I am remembering the last
selected item's row position  in an instance variable in  the list

The problem is, when I select an item and then touch the edit box of
another item, my tracked item position is not of the edit box I have
focused on, it's the last selected items position.

How can I track the position of the compound view whose edit box just
got touched?
Any help will be much appreciated.


3. Best practices for library with UI component

4. Strange activity stack issue

5. SimpleCursorAdapter()

6. Design

7. Sensor and Compass APIDemo failing on emulator 1.5