3

I've a little problem... I'm doing a small web browser in my app, and the problem is that I can't login on some websites like Evernote or Bitbucket. When I'm submiting the form, I'm redirected on the form's page, like I just refreshed the form instead of submiting it. I've enabled Javascript on the webview.

Has someone already had this problem ? Thanks !

allprog
  • 16,540
  • 9
  • 56
  • 97
Kyu_
  • 800
  • 4
  • 10
  • 18

2 Answers2

2

I would use an external web browser for such a purpose, you can open it from your app with an intent. WebView only handle simple HTML web pages, for example it does not support java script.

Extracted from WebView class description http://developer.android.com/reference/android/webkit/WebView.html

Basic usage

By default, a WebView provides no browser-like widgets, does not enable JavaScript and web page errors are ignored. If your goal is only to display some HTML as a part of your UI, this is probably fine; the user won't need to interact with the web page beyond reading it, and the web page won't need to interact with the user. If you actually want a full-blown web browser, then you probably want to invoke the Browser application with a URL Intent rather than show it with a WebView.

L. G.
  • 9,642
  • 7
  • 56
  • 78
  • For some reasons, I need and I have a web browser on my app, so it'll be stupid to redirect user to another browser app, you don't think ? – Kyu_ Aug 26 '13 at 09:26
  • That was just an advice. Did you try to set setWebChromeClient? http://developer.android.com/reference/android/webkit/WebView.html#setWebChromeClient(android.webkit.WebChromeClient) In any case it will be tricky to support complicated webpages, see for example http://stackoverflow.com/q/7373585/891479. – L. G. Aug 26 '13 at 11:49
  • No problem ! Yes I'm using a webChromeClient. I'll read the stackoverflow's thread. – Kyu_ Aug 26 '13 at 12:29
2

Use the default cache mode:

mWebView.getSettings().setCacheMode(WebSettings.LOAD_DEFAULT);
Arnaud SmartFun
  • 1,573
  • 16
  • 21