Sunday, 21 July 2013

closing Background processes from Android app.

As of Android 2.2 and above you can only kill background processes. If you want to kill a background process you can use the following android snacks:

         public void KillBackgroundProcess(String packagename)
          {
            
         private ActivityManager objactivitymngr =  
             (ActivityManager) this.getSystemService(ACTIVITY_SERVICE); 
 
             objactivitymngr.killBackgroundProcesses(packagename);

           }

Note :-  Also This permission is required in your android manifest
         
               android.permission.KILL_BACKGROUND_PROCESSES

No comments:

Post a Comment