Hi Dianne, Sorry to bother you.
Does the "Force stop" in the setting of android 2.2 also use "KillBackgroundProcess" or use the system level API (developer can't use directly) to make it? I have tried the "KillBackgroundProcess" and adding the related permission, but it can't stop the running app either or running service like "Force stop" does. //ddms under "Force stop" 06-15 22:08:10.505: INFO/ActivityManager(62): Force stopping package com.MyTestApp/com uid=10037 06-15 22:08:10.505: INFO/Process(62): Sending signal. PID: 647 SIG: 9 //ddms under my KillBackgroundProcess 06-15 22:05:32.725: INFO/Process(62): Sending signal. PID: 638 SIG: 9 06-15 22:05:32.754: INFO/WindowManager(62): WIN DEATH: Window{43f4b2d8 com.MyTestApp/com.MyTestApp.act1 paused=false} 06-15 22:05:32.754: INFO/WindowManager(62): WIN DEATH: Window{43fbd930 com.MyTestApp/com.MyTestApp.act2 paused=false} "Force stop" and my "KillBackgroundProcess" seems to have sent the same signal 9. but they behave differently. I don't know why it doesn't work in my "KillBackgroundProcess". Thanks very much! On 6月3日, 上午6時41分, Dianne Hackborn <hack...@android.com> wrote: > On Wed, Jun 2, 2010 at 1:18 AM, Lee <lee.wil...@googlemail.com> wrote: > > killBackgroundProcesses works (you need a permission for it), but it > > merely restarts the background services, so it's a little poorly > > named. > > Actually it does exactly what it says -- it kills a process. If an > application has a service that it wants to keep running, the normal behavior > of the system kicks in to restart the service for the app. As the > documentation says, this allows the app to do the same thing is the out of > memory killer (killing processes) without breaking applications by causing > their services to be stopped when they don't expect (or unregister their > alarms or the other things that fully stopping an app does). > > -- > Dianne Hackborn > Android framework engineer > 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. -- 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