Good day!

How can I close the browser window on Android? By any means, but preferably JavaScript . The window.close() ... window.blur() method does not work in any of their realities.

UPD1 :
How to open WebView , load a page there and then close it?

    2 answers 2

    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:

    1. You need to get the PID of the process - you can get it through ActivityManager
    2. 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:

    1. We must have acc. permishen (something android.permission.KILL_BACKGROUND_PROCESSES )
    2. The process must be started by the same user on whose behalf you are trying to kill or you must have root rights
    • That's about WebView - what you need! More? And then I'm still an oak tree in these technologies :) - Anton Mukhin
    • Updated the question. - Anton Mukhin
    • one
      what questions are not clear, but then only clear boys))) what does it mean to open and so on? Flick your finger on the screen until the browser opens, then enter the address, wait and close)) but in general clarify the question and - Gorets

    activity.finish ();

    • Where is that? Plus, I dug out that the browser from another program does not open. To my question, there is no answer in the course. - Anton Mukhin
    • when the "other program" is running, the browser will be minimized. Given the specifics of the android, minimized is almost equivalent to the closed one - just because you can not close the program on the android. In my opinion, closing the browser window from pressing a button is not very good, unless it pops up a window. - KoVadim