My Android app has a WebView that requires the Flash plugin. The webview will provide a Market link to Adobe Flash if it’s not installed. After installing Flash, the only way to instantiate it in my app is to force quit and restart the app. I would like to present a button to the user that does this for them because it’s too complicated for casual users to open up their running processes and force quit the app manually. What is the Java code to implement such a restart button?
My Android app has a WebView that requires the Flash plugin. The webview will
Share
You can restart your app in two steps:
Process.myPid(), pass it intoProcess.killProcess(). You might need to add a permission to your manifest (possiblyandroid.permission.KILL_BACKGROUND_PROCESSES) to get this to work.alarm.setis thetriggerAtTime. Setting it to 0 causes the alarm to fire immediately. The example here sets a time to launch the app one second into the future.The Code goes like this: