Click here to Skip to main content
15,895,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my app project my emulator appears without 'hello world'.
I am able to see the clock and other settings but not my app's 'hello world'.
Can anyone help me out?


XML
<resources>

    <string name="app_name">My Application</string>
    <string name="hello_world">Hello world!</string>
    <string name="action_settings">Settings</string>
    <string name="title_activity_main">MainActivity</string>
</resources>


Java
package com.example.rajendran.myapplication;


import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.app.Activity;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }


}



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" >

    <textview>
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"

        android:text="@string/hello_world"
        tools:context=".MainActivity" />

    </textview>
</relativelayout>
Posted
Updated 23-Jan-15 23:17pm
v2
Comments
Richard MacCutchan 24-Jan-15 5:18am    
Did you try to start the application in the emulator from the applications screens?

1 solution

Quote:
Instead of using your finger, use your mouse to swipe and click (touch) on the AVD. Swipe the key lock symbol all the way to the left until it is out of the way to unlock the screen, go to home, flip through the menu, until you find this green robot icon called

Refer to Figure 12 in Creating a Simple Hello World Android Project[^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900