• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Android Hello world is not working in Emulator

flipmedia

Lurker
I am a newbie in Android . When I run my first **HelloWorld** program I face the same problem. I cannot get the text with "Hello World" . I got the emulator with it's options .
Do any one can say what's my problem ? I am working in Windows 7.

my code is given below:

HelloAndroidActivity.java
===========================
package com.example.helloandroid;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public class HelloAndroidActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);

}
}

AndroidManifest.xml
=======================
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.helloandroid"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk android:minSdkVersion="14" />

<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<activity
android:name=".HelloAndroidActivity"
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>


please advise me , add the Emulator output I got. :confused:

Thanks
Anes
 

Attachments

  • android doubt preview.jpg
    android doubt preview.jpg
    59.1 KB · Views: 150
I typed exactly what your code says, and mine runs fine.

Did you wait for the emulator to finish loading? Judging by the attached picture in your post, the emulator wasn't loaded all the way. It does take a few moments to load.
 
Hi Javasirc,
Thanks for your reply. Dear I wait 3 minutes and fully loaded ... please look
the screenshot as I reach ... reply me

Thanks
Anes:o
 

Attachments

  • revisedpic.jpg
    revisedpic.jpg
    46.5 KB · Views: 110
Slide the lock thing to the right. It will unlock. When it does it will load your app.

Note that the emulator runs very slow. Just be patient with it.

And as a tip, you do not need to close your emulator. Just use Run Configuration when you run the app and select the emulator. It will automatically resend your app to the emulator and reload it.
 
Back
Top Bottom