开发者

How can we move to previous screen when action performed

I am new to android...I want to move back to the previous screen whe开发者_如何学运维n i pressed some button in current screen..how can we implement? ... Thanks in advance


To end the current activity and go to the previous activity you can just call finish()


Within the onClickListener for the button you put finish();


If preserving the state of the first activity not important you can just create an Intent and just call the first activity. Here how you can do that.Do this at second activity which will call the first one.

Intent myIntent = new Intent();         myIntent.setClass(getApplicationContext(),NameOfTheFirstActivityClass.class);
startActivity(myIntent);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜