Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Matar uma aplicação via código

Eu já fiz uma vez, mas o device era rooteado...

2016-06-22 17:17 GMT-03:00 Gorio <goriofab@gmail.com>:
Boa tarde,

Alguém saberia me dizer se consigo parar uma aplicação (pelo nome do pacote ou pid) ?

Já tentei algumas coisas, mas não consegui parar..

try {
ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);

Log.e("GORIO", p.getPackageName() + " : " + p.pid);
android.os.Process.killProcess(p.pid);
android.os.Process.sendSignal(p.pid, android.os.Process.SIGNAL_KILL);
manager.killBackgroundProcesses(p.getPackageName());
} catch (Exception e) {
e.printStackTrace();
}

​Obrigado​

Atenciosamente

Gorio
(www.gorio.eng.br)

 

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário