我用下面的代码在主activity打开我自定义的类Speak2
Intent i = new Intent("R.voice.Speak2"); startActivity(i);
在voice.xml布局中设置的按钮,当我点击按钮会调用activity Speak2。
没有实现这个功能。
还有相关的代码:
public class recon extends Activity implements OnClickListener{ ListView lv; static final int check = 2000; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.voice); lv = (ListView)findViewById(R.id.lvVoiceReturn); Button b = (Button)findViewById(R.id.bVoice); b.setOnClickListener(this); } public void onClick(View v) { // TODO Auto-generated method stub Intent i = new Intent(recon.this , Speak2.class); startActivity(i); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { // TODO Auto-generated method stub super.onActivityResult(requestCode, resultCode, data); } }
请大家帮忙找找问题所在。
相关分类