1

I'm using a Webview to perform an OAuth Authentication. Within the login page, there's a "Remember Username" checkbox which probably saves the user name within the username textfield.

But checking it, doesn't really save the username for my webview. (it's always blank)

Is there any way to get the "Remember Username?" Feature working. Remember I have no access to the username.

If it's not possible, I'd like to confirm that aswell. Thanks.

EDIT: I need the webview to remember the username even after the application has shut down. The next time i load the same page, the username should be there. There seems to be a setSaveFormData function. But that doesn't seem to help.

st0le
  • 33,375
  • 8
  • 89
  • 89

2 Answers2

1

May be the following links solve your issues.

Saving Android Activity state using Save Instance State

Android WebView- remember username and password

Make Android WebView not store cookies or passwords

Community
  • 1
  • 1
UVM
  • 9,776
  • 6
  • 41
  • 66
0

if (savedInstanceState == null) { mwebView.loadUrl("http://abc.com"); } else { mwebview.restoreState(savedInstanceState); }

Try using the above lines when you are loading the url to webview... If the above wont work you can overide the onSaveInstanceState(Bundle savedInstanceState).

For more reference refer this LINKThen try this......

WebSettings websetting = yourwebviewinstance.getSettings(); mWebSettings.setSavePassword(true);

Shankar Agarwal
  • 34,573
  • 7
  • 66
  • 64