I'm trying to figure out how i can handle Javascript pop's in a webview, I have a WebView that is viewing a admin screen of a device on my network. Similar to a router, It has a administration section that then prompts a dialog box with a Username and Pswd field, However in my WebView i get no popup and instead get a 401 Error.
Great example of handling the dialog popup box is in Dolphin browser, they have provided a custom dialog with the two username and password fields.
I believe the below code is what i need to handle the Javascript for the pop up, however i need to create ad username and password dialog that will input the string's that are needed by the webpage.
Any idea's, recommendations, source code, is really appreciated. Thanks,
public boolean onJsAlert(WebView view, String url, String message, final JsResult result)
{
new AlertDialog.Builder(Mosembro.this)
.setTitle("javaScript dialog")
.setMessage(message)
.setPositiveButton(android.R.string.ok,
new AlertDialog.OnClickListener()
{
public void onClick(DialogInterface dialog, int which)
{
result.confirm();
}
})
.setCancelable(false)
.create()
.show();
return true;
};