0
public class check extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
void myonclick(View view)
{
Intent mIntent = new Intent(this,check2.class);
startActivity(mIntent);
}
}
class check2 extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
// super.onCreate(savedInstanceState);
// setContentView(R.layout.main);
Toast.makeText(
this,
"Welcome to second page", Toast.LENGTH_LONG).show();
finish();
}
}
嗨。這是我運行此代碼時的代碼。當我點擊一個按鈕時,它會在模擬器中顯示錯誤:應用程序檢查已意外停止。從一個屏幕導航到另一個屏幕不工作在android
感謝dude..i了它now..i didnt宣佈在清單中的活動.. – bharath 2010-11-23 07:15:50
一個問題,因爲只有一個main.xml中假設我的check2假設我想有其他領域應該在哪裏做.. – bharath 2010-11-23 07:17:09