1. Download our Official Android App: Forums for Android!

Apps Hello World application not showing

Discussion in 'Android Development' started by AndroidDevNoob, Jun 26, 2011.

  1. AndroidDevNoob

    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jun 26, 2011

    Jun 26, 2011
    2
    0
    5
    Hi guys

    Sorry to bore you with a 'Hello World' question. The problem is I can't get my application to show 'Hello World'. My emulator loads fine and the device is started. From here i drag the locked icon across which takes me to the main screen but it doesn't have hello world anywhere.

    I searched everywhere for a solution and still can't do a basic hello world application. Any help I will vastly appreciate.

    Code (Text):
    1.  
    2. package com.example.helloandroid;
    3.  
    4. import android.app.Activity;
    5. import android.os.Bundle;
    6. import android.widget.TextView;
    7.  
    8. public class HelloAndroid extends Activity {
    9.     /** Called when the activity is first created. */
    10.     @Override
    11.     public void onCreate(Bundle savedInstanceState) {
    12.         super.onCreate(savedInstanceState);
    13.  
    14.         TextView tv = new TextView(this);
    15.         tv.setText("Hello, Android");
    16.         setContentView(tv);
    17.     }
    18. }
    19.  
     

    Advertisement

  2. JiMMaR

    JiMMaR Android Enthusiast
    Rank:
    None
    Points:
    53
    Posts:
    363
    Joined:
    Jun 12, 2010

    Jun 12, 2010
    363
    57
    53
    wait for the emulator to load fine , after you unlock wait for the homepage to show up
    also .. don't close the emulator while you are working , just run again from eclipse and it should work
     
    AndroidDevNoob and alostpacket like this.
  3. AndroidDevNoob

    Thread Starter
    Rank:
    None
    Points:
    5
    Posts:
    2
    Joined:
    Jun 26, 2011

    Jun 26, 2011
    2
    0
    5
    hi JiMMaR, thanks a million! I finally got it show, the only problem is that it doesn't always work. When I run it again it says: emulator: ERROR: the user data image is used by another emulator. aborting

    Sometimes it doesn't show that and will show hello world. Any suggestions?
     

Share This Page

Loading...