
February 5th, 2012, 01:58 PM
|
|
Registered User
|
|
Join Date: Feb 2012
Posts: 3
Time spent in forums: 54 m
Reputation Power: 0
|
|
Quote: | Originally Posted by myandroid Hi, I'm a newbie; trying to get started with a simple hello world program to run on the emulator. I see the emulator with "ANDROID", but no "Hello, Android" text on the screen. I'm using Window 7 Home Premium edition, Android SDK for windows, Android 4.0 platform, Java SE 7u2, Eclipse IDE for Java Developers.
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView tv = new TextView(this);
tv.setText("Hello, Android");
setContentView(tv);
}
Please advise. Thanks. |
you haven't linked your Text view to the xml reference.
Textview tv = [TextView] findViewBy.Id(R.id.xmlidreference);
in other words, the java can't tell which textview you are trying to change so nothing is happening
|