As part of JavaScript is unlikely ...
And if with Java, then if it is a question of closing the WebView
launched from your program, then the @Gorets answer will be overridden. And if it is a question of closing the browser from another program, then it is difficult:
- You need to get the PID of the process - you can get it through
ActivityManager
- Knowing the PID of the process can kill (kill)
android.os.Process.killProcess(process.pid);
This is in theory, but in practice it is surrounded by restrictions:
- We must have acc. permishen (something
android.permission.KILL_BACKGROUND_PROCESSES
) - The process must be started by the same user on whose behalf you are trying to kill or you must have root rights