Create a user interface in code.
package app.test;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class Test extends Activity {
@Override
public void onCreate(Bundle icicle) {
super.onCreate(icicle);
// Create a new TextView object
TextView myTextView = new TextView(this);
// Assign the TextView to be the Activity's UI
setContentView(myTextView);
// Update the TextView properties
myTextView.setText("Hello, Android");
}
}
Related examples in the same category