title: How to handle JavaScript dialog popup in WebView
body: <p>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.  </p>
  
  <p>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.</p>
  
  <p>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. </p>
  
  <p>Any idea's, recommendations, source code, is really appreciated. Thanks,</p>
  
  <pre><code>  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;
          };
  </code></pre>