@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button sendBtn=(Button)findViewById(R.id.button1);
sendBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent=new Intent(MainActivity.this,Send.class);
startActivity(intent);
}
});
}
我有那個按鈕一個按鈕,點擊我想開第二個活動名爲發送,但應用程序不幸停止logcat中顯示這樣的錯誤:試圖從我的主要活動呼叫活動如下
04-07 13:39:33.040: E/AndroidRuntime(2426): android.content.ActivityNotFoundException: Unable to find explicit activity class {com.send/com.send.Send}; have youdeclared this activity in your AndroidManifest.xml?
'你有沒有在你的AndroidManifest.xml中聲明這個活動? – Blackbelt