当我点击此代码中的btn_shapes
时,我的应用程序停止了。btn_alphabet
和btn_know
工作正常,但在btn_shapes
应用程序停止。没有键盘用于id 0使用默认键盘映射:/system/usr/keychars/qwerty.kcm.bin
public class Eng extends Activity implements OnClickListener {
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.eng);
Button alphabet = (Button) findViewById(R.id.btn_alphabet);
alphabet.setOnClickListener((OnClickListener)this);
Button bshapes = (Button) findViewById(R.id.btn_shapes);
bshapes.setOnClickListener((OnClickListener)this);
Button know = (Button) findViewById(R.id.btn_know);
know.setOnClickListener((OnClickListener)this);
}
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId()){
case R.id.btn_alphabet:
Intent s_alphabet = new Intent(this, Alphabet.class);
startActivity(s_alphabet);
break;
case R.id.btn_shapes:
Intent s_shapes = new Intent(this, Bshapes.class);
startActivity(s_shapes);
break;
case R.id.btn_know:
Intent s_know = new Intent(this, Know.class);
startActivity(s_know);
break;
}
}
}
答案 0 :(得分:1)