you can use restartPackage both api 8 and 7. the api is deprecated but exists in api 8 and redirect to killBackgroundProcesses (I use it and it works)
On 30 mai, 17:15, Mats <matshof...@gmail.com> wrote: > Hi, > > I want my app to kill a running app but i got the problem that since > API 8 the method is deprecated and i need to use another function. > > So i want that if API level of the device is smaller than 8 it runs > this > > ActivityManager aM = (ActivityManager) > this.getSystemService(ACTIVITY_SERVICE); > aM.restartPackage(package); > > And from 8 this > > ActivityManager aM = (ActivityManager) > this.getSystemService(ACTIVITY_SERVICE); > aM.killBackgroundProcesses(package); > > But how do i accomplish this because using something like an if will > make the compiler complain. > > Mats -- 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