Guest User

Untitled

a guest
Feb 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. alertDialog.setTitle("Authorization Required");
  2. alertDialog.setMessage("Please enter your username and password for http authentication.\nError: Status Code 401");
  3. final EditText htuser1 = new EditText(this);
  4. final EditText htpass1 = new EditText(this);
  5. alertDialog.setView(htuser1);
  6. alertDialog.setView(htpass1);
  7. alertDialog.setButton("Login", new DialogInterface.OnClickListener() {
  8. public void onClick(DialogInterface dialog, int which) {
  9. htuser = htuser1.toString();
  10. htpass = htpass1.toString();
  11. login(username, password, url);
  12. }
  13. });
  14. alertDialog.setButton2("Cancel", new DialogInterface.OnClickListener() {
  15. public void onClick(DialogInterface dialog, int which) {
  16. username2.setEnabled(true);
  17. password2.setEnabled(true);
  18. button.setEnabled(true);
  19. }
  20. });
  21. alertDialog.show();
Add Comment
Please, Sign In to add comment