0
我得到了一些錯誤,我的主要活動代碼添加另一項活動「切換」錯誤在活動中加入另一項活動「切換」
這裏的時候,當我的代碼:
package com.frede.fusrodah;
public class FusRoDAHActivity extends Activity {
@Override
public void onBackPressed() {
return;
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.main);
Button next = (Button) findViewById(R.id.button1);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(view.getContext(), FusRoDAH.class);
startActivityForResult(myIntent, 0);
Button next = (Button) findViewById(R.id.button4);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(view.getContext(), FusRoDAHnommusic.class);
startActivityForResult(myIntent, 0);
}
}
);
}
}
我得到了一些錯誤與一些「}」有人能幫我糾正它嗎?
我寫了這段代碼,然後它有點壞了?
Button next = (Button) findViewById(R.id.button4);
next.setOnClickListener(new View.OnClickListener() {
public void onClick(View view) {
Intent myIntent = new Intent(view.getContext(), FusRoDAHnommusic.class);
startActivityForResult(myIntent, 0);
爲什麼你在另一個按鈕的點擊事件中嵌入一個按鈕 – Ishu 2012-04-01 07:30:51