0

I need to kill an application when i receive a key event in phonewindowmanager.java

try {
    ActivityManagerNative.getDefault().killApplicationProcess("com.konka.fakestandby", 1000);
} catch (RemoteException e) {}

but it restart again log

I/ActivityManager( 1737): Process com.konka.fakestandby (pid 3571) has died.
10-17 16:44:12.448 
I/WindowState( 1737): WIN DEATH: Window{422cd068 u0 com.konka.fakestandby/com.konka.fakestandby.MainActivity}
10-17 16:44:12.472 
I/ActivityManager( 1737): Start proc com.konka.fakestandby for activity com.konka.fakestandby/.MainActivity: pid=3603 uid=10024 gids={50024, 1028}

i am confused,and hope someone help me. Thanks

2 Answers2

0
  1. If fakestandby is your own app. You need to stop the activity and not kill the process.

  2. If it is not your app then it could be be restarting service (sticky).

  3. If it is not that then the android framework is designed to relaunch an installed app when it has free memory to allocate. If this is the case u need to uninstall the app after killing. For that u need to have root access.

Utsav Gupta
  • 3,785
  • 5
  • 30
  • 52
  • Thank you @user2103379 1.fakestandby is not my own app. 2.I know fakestandy is just a very simple application output helloworld,when you create an project with eclipse,a default MainActivity.java and activity_main.xml will be created,fakestandy is an application like this. 3.maybe you are right,android framework is designed to relaunch an installed app when it has free memory,but i can't uninstall the app after killing,because when standy next time,i need to relaunch it. – picksomething Oct 22 '14 at 02:15
  • understood..give me some time i'll comment on that. – Utsav Gupta Oct 22 '14 at 09:37
0

HI please refer link possible solution , I think it might help your problem.

Community
  • 1
  • 1
satej k
  • 89
  • 2
  • 13
  • Thank you first,but this is not the answer for my question,i want to kill an other application rather than finish all activities when exit an application. – picksomething Oct 22 '14 at 01:48