Look at what your main thread is doing when the ANR happens. It may not be directly related to the stopSelf() at all -- you may have some code in a completely different location that is blocking the main thread, and the stopSelf() call just happens to cause the system to try to interact with your app, find it isn't responding, and result in an ANR.
On Tue, Jan 6, 2009 at 11:03 AM, jsm <[email protected]> wrote: > > I have two doubts > - When I call stopself() in the service, it raises an ANR (Force close > or Wait) > I am calling this in a seperate thread as shown in my service: > ... > quitServer(){ > Thread thrm = new Thread(null, mTask, "MYService"); > thrm.start(); > > } > > Runnable mTask = new Runnable() { > public void run() { > disconnectServer(); > stopSelf(); > } > }; > ... > I am pretty sure there are no other activity going on while i am > trying to quit because I can see from the server it has successfully > quit. > Any help or suggestion would be appreciated. > > > > > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---

