Kill application without root

Asked

Viewed 132 times

1

Is there any way to kill another application (other than mine) via code without using a root command for it? I’m trying to use the command "am force-stop" but without success.

  • You just want to close the application or destroy it?

  • I don’t want to kill my app, I want to kill others who are being executed.

3 answers

0

  • I can kill another application through root commands like "Kill -9 pid", but for that I need root access. I wanted an alternative to this, not to send a message to the other app

  • @Luizhenriquealegria I never researched, but probably not possible without root.

  • 1

    @Erickfilho possible should be, since it has apps that kill applications without root. Battery Doctor is an example.

  • @Luizhenriquealegria Verdade, have a look here: http://developer.android.com/reference/android/app/ActivityManager.html#killBackgroundProcesses(java.lang.String) will it help you? Try playing Youtube pakageName.

  • @Erickfilho almost got it with Activitymanager, but it hasn’t worked yet. This method only kills applications related to my application.

-1

You can use to destroy:

Finish();

Use this method to "kill" the root-less application.

  • I believe I was not very clear in my question. I wish to kill another application and not my own.

  • Then just implement the onDestroy method.

  • onDestroy? how could I for example kill the youtube application just with this method?

-1

    @Override
    public void onDestroy() {
       super.onDestroy()
    }
  • Could you explain your answer?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.