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 trialtshuutheniemvula
7,251 PointsGetting intent from MainActivity to BlogWebView, getData() method not recognised
Stage 5 Using Intents to Display and Share Posts:
When updating WebView with data from MainActivity using:
Intent intent = getIntent(); Uri blogUri = getData();
WebView webView = (WebView) findViewById(R.id.webView);
webView.loadUrl(blogUri.toString());
I am not able to get the Intent from MainActivity so Uri Object does not receive data and GetData method not recognised.
I am unsure about how to proceed.
tshuutheniemvula
7,251 Pointstshuutheniemvula
7,251 PointsSOLVED: I forwent declaring getting the Intent explicitly and just created Uri object and used getIntent() method to get data directly like:
Uri blogUri = getIntent().getData();