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 Simple Android App (2014) Creating the Screen Layout Adding a TextView

Matthew Puentes
Matthew Puentes
999 Points

No title bar and xml loading strangely

I have downloaded android studios before but i tried uninstalling and deleting files because whenever i create a new project the xml loads strangely (still functional). The code will look like android:something android:something android: tools android:something (it doesn't actually say something). The formatting is strange. Also, I don't see the title bar at the top with a Android icon. I just see the text box screen saying "Hello World". Is there something wrong with my files?

Thank you

What OS are you on?

I had a problem on linux before. Not Windows 8. Sorry to say but I can't help with this one. If no-one can help with this, try asking stackoverflow. They may have people who know a little bit more into the IDE and how to fix this rather than problems with code. Not saying there's anyone here who knows how to fix this.

It might be helpful to post a screenshot of the issue.

2 Answers

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Matthew;

Here is what my XML looks like as a new project with no edits:

activity_main.xml
<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"
                android:paddingLeft="@dimen/activity_horizontal_margin"
                android:paddingRight="@dimen/activity_horizontal_margin"
                android:paddingTop="@dimen/activity_vertical_margin"
                android:paddingBottom="@dimen/activity_vertical_margin"
                tools:context=".MainActivity">

    <TextView
        android:text="@string/hello_world"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

</RelativeLayout>

and the manifest:

AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.zyzzyxtech.testhelloworld" >

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

Is that what yours looks like?

Ken

Ken Alger
Ken Alger
Treehouse Teacher

Oops.

Forgot to include...

styles.xml
<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
    </style>

</resources>

my title bar isnt appearing either?