Answers for "kill other apps in kotlin"

1

kill other apps in kotlin

// add this permission to AndroidManifest.xml
<uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/>
  
//and use this code to kill the process
  
val am = getSystemService(Activity.ACTIVITY_SERVICE) as ActivityManager
am.killBackgroundProcesses(packageName)
Posted by: Guest on August-07-2020

Browse Popular Code Answers by Language