public class Menu extends Activity {
/** Called when the activity is first created. */
public void onCreate(Bundle icicle) {
//myIntent.setClassName("hello.World", "hello.World.mybuttonclick");
// myIntent.putExtra("com.android.samples.SpecialValue", "Hello, Joe!"); // key/value pair, where key needs current package prefix.
//startActivity(myIntent);
//Button myButton = (Button) findViewById(R.id.my_button);
super.onCreate(icicle);
setContentView(R.layout.main);
}
public void updateLayout(){
Intent myIntent = new Intent(Menu.this, mybuttonclick.class);
startActivity(myIntent);
// TextView sayHello = (TextView) findViewById(R.id.Hello);
}
}
嗨,我是一个新的Android的Java的学生,我们要开发一个简单的Hello World应用程序..我找到了一些困难,让我的onClick()活动工作,使用android:在xml中的Onclick ..我想要做的是改变内容视图做显示一个简单的不同的布局,并说你好..我使用setContentLayout来做到这一点,每次我点击说按钮tho android应用程序崩溃了..我做错了什么?的Android(学生CW)需要方向的
问候,
斯特凡