有一个android跳转activity界面,怎么实现不了,程序在补充中,求大神解答
publicclassMainActivityextendsActivity{@OverrideprotectedvoidonCreate(BundlesavedInst...
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button0 = (Button) findViewById(R.id.button0);
button0.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this,
SecondActivity.class);
startActivity(intent);
}
});
在AndroidManifest.xml中已经定义过SecondActivity 展开
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button button0 = (Button) findViewById(R.id.button0);
button0.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Intent intent = new Intent(MainActivity.this,
SecondActivity.class);
startActivity(intent);
}
});
在AndroidManifest.xml中已经定义过SecondActivity 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询