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

White gap between the content and Action Bar?

I seem to be getting a white gap between the Action Bar and the webpage content/blog post. I followed all the steps in this video (and I also took out the padding in the xml file). Any idea why this is happening or how to fix it? Thanks!

This is what it looks like.

This is the code from my activity_blog_web_view.xml layout file:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.kristen.blogreader.BlogWebViewActivity" >

    <WebView
        android:id="@+id/webView1"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_alignParentLeft="true"
        android:layout_alignParentTop="true" />

</RelativeLayout>

Maybe Ben Jakuben can help?

Joseph Greevy
Joseph Greevy
4,990 Points

I have a different problem when you created your new class did it give you a fragment? My app crashes and it seems to be because of this fragment in my code e.g my code reads

tools:context="com.multiplis.therugbytimes.BlogWebViewActivity$PlaceholderFragment" >

Joseph Greevy: I'm not sure I understand your question. Can you make a more detailed post on the forum? I'll see if I can figure out the issue and maybe some others will be able to help too.

Joseph Greevy
Joseph Greevy
4,990 Points

No worries I saw some of the problem it made a fragment xml file and a normal one so I think I can fix it

Ok, good luck!

1 Answer

Harry James
Harry James
14,780 Points

I get this white bar as well. I didn't think much of it though.

I assume that this is just an issue in the way the site is coded. Maybe the "Start learning for free today! (14-day trial) PICK YOUR PLAN" message isn't displaying and is what's causing this white space. I am not sure.

It's not a problem in the code you have written, however. So, you can carry on as normal.

I thought that might be the issue too, so I modified the Blog Reader app to view a different blog. I just finished it and there's no white gap :)

Thanks for your response!

Harry James
Harry James
14,780 Points

Ah, nice plan! That's the beauty of the MVC pattern! All you need to change is the URL and bam, everything's updated!

Unfortunately, it wasn't that simple since the JSON for the new blog was more complicated, but I was able to make the necessary changes.