1

I've been following this series of Android Development Tutorials and I've encountered some problem trying to tweak one of the projects I've created.

Basically all I want to know is how to apply the WebView correctly in my project - in the easiest and most simple way possible.

What I've done: enabled permission to the internet on the manifest created the webview on the main_activity.xml imported the WebView webkit to my MainActivity Java class

And all I've done after that is simply loading the url on my onCreated method like this:

protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); WebView v = (WebView) findViewById(R.id.weblol); v.loadUrl("www.google.com"); } 

However nothing seems to happen and the block of the WebView remains blank white

Care to explain to a noob what am I doing wrong ?

1

1 Answer 1

1

You should use http://www.google.com instead of www.google.com.
Only you to this,webview can notice this it is a URL.

Otherwise.you can use local file in webview ,like file:///android_asset/xxx in assets folder.
That's all.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.