reptile7383
Lurker
I completed this Linear Layout Tutorial and I was wanting to play around with it a bit. So I'm trying to change the text 'red' to something else. In the XML I added
to the TextVeiw
and I'm trying to use
to change the text on startup but it just throws up an error and crashes.
Thanks for the help.
Code:
android:id="@+id/red"
to the TextVeiw
and I'm trying to use
Code:
public class HelloLinear extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
TextView newText;
newText = (TextView) findViewById(R.id.red);
newText.setText("red");
setContentView(R.layout.main);
}
}
to change the text on startup but it just throws up an error and crashes.
Thanks for the help.