0

Hell got a very simple app,

import android.app.Activity;
import android.os.Bundle;
import android.webkit.WebView;

public class main extends Activity {

    WebView mWebView;

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        mWebView = (WebView) findViewById(R.id.webView1);
        mWebView.getSettings().setJavaScriptEnabled(false);
        mWebView.loadUrl("http://www.purelymean.com/app_pics");
    }
}

But for some reason when I run it it opens the app, then opens the phones web browser as well?

MrJoshFisher
  • 1,143
  • 5
  • 21
  • 48
  • 2
    http://stackoverflow.com/questions/9986788/android-webview-click-open-within-webview-not-a-default-browser – androidu Mar 13 '13 at 20:41

1 Answers1

0

you should add a WebViewClient to your WebView. The default one opens the Browser and this is what you are experiencing.

yarons
  • 294
  • 2
  • 3