Hi
I will create twi TextView in the main layout, but only last
TextView can be showed.
My codes:
package myapp.helloworld;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import android.graphics.Color;
public class helloworld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TextView tv1 = new TextView(this);
tv1.setText("This is sample.");
tv1.setTextColor(Color.RED);
setContentView(tv1);
TextView tv2 = new TextView(this);
tv2.setText("This is yellow.");
tv2.setTextColor(Color.YELLOW);
setContentView(tv2);
}
}
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---