-4

I have a question about android programming in Eclipse. I have 2 activities that one is being called after an image button click, using the code:

setContentView(R.layout.activity_about);

Now, when I want to do the programming of back image button in second activity (activity_about) I can't, because onCreate(Bundle savedInstanceState) is not being run in my opinion. Can anyone help me, please?

4

1 回答 1

1

如果我没有误解你的问题,你是想通过 ? 打开第二个活动setContentView?在 Android 中,您正在使用 Intents 打开 Activity,当您想要返回时,只需调用finish()您的第二个 Activity。打开你的活动就完成了

Intent newIntent = new Intent(this, AboutActivity.class);
startActivity(newIntent);

而 AboutActivity 有setContentView

于 2013-07-25T21:46:59.410 回答