1

I would like to kill third party app(Google navigation) at my own discretion. Based on this in the docs, it sounds like I can use killProcess(int Pid) to kill the process with that id and any other process created by that same id. The kernel has restrictions on who can cancel a given process for security reasons. But I wasn't able to stop the navigation using that method. What am I missing? How can I accomplish what I am trying to do? I am using something to this effect to launch the navigation

Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=" + address));
                intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK&Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
                intent.setClassName("com.google.android.apps.maps", "com.google.android.maps.MapsActivity");
            activity.startActivity(intent);
The_Martian
  • 3,684
  • 5
  • 33
  • 61
  • 2
    `Typically this means only the process running the caller's packages/application and any additional processes created by that app; packages sharing a common UID will also be able to kill each other's processes.`(http://developer.android.com/intl/ko/reference/android/os/Process.html#killProcess%28int%29): As long as you have the ownership of a process, you are able to kill it. Starting an activity offloads the call to the system, so you are not able to kill it using `killProcess()`. – GiantTree Nov 20 '15 at 22:51
  • The part "any additional processes created by that app" is confusing. It sends the message that making a call to another process can be killed using that method, which is not the case. I appreciate your answer. Thanks. – The_Martian Nov 20 '15 at 23:10
  • Is it possible to send alert dialog or something so the user can hit ok and return them to the app that called the navigation? – The_Martian Nov 20 '15 at 23:11
  • I think you are looking for answers like here: https://stackoverflow.com/questions/12838230/ways-to-bring-an-android-app-in-background-to-foreground – GiantTree Nov 21 '15 at 13:23

0 Answers0