Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Blog Reader Android App Using Intents to Display and Share Posts Opening a Webpage Within the App

Simone Galimberti
Simone Galimberti
3,054 Points

Glitch

I am losing my mind trying to pass the third step. I insert this (i believe I followed the instructions)

import android.os.Bundle;
import android.content.Intent;
import android.net.Uri;
import android.webkit.WebView;

public class WebViewActivity extends Activity {

    protected String mUrl;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_web_view);

        WebView webView = (WebView) findViewById(R.id.webView1);

        // Add code here!
      Intent intent=getIntent();
      Uri passed=intent.getData();
      String mUrl;
      mUrl=passed.toString();
    }
}

2 Answers

Ben Jakuben
STAFF
Ben Jakuben
Treehouse Teacher

Sorry for your trouble! You have redefined mURL, which isn't allowed:

protected String mUrl;

Just delete this:

String mUrl;

Simone Galimberti
Simone Galimberti
3,054 Points

I really love you, so much! (I wonder, if you have time...could you check this issue https://teamtreehouse.com/forum/url-not-loading ?)

Ben Jakuben
Ben Jakuben
Treehouse Teacher

Haha - thanks, and on that other one now!