开发者

Previous Activity does not come on pressing back button

开发者 https://www.devze.com 2023-04-01 20:32 出处:网络
I am calling one activity from anothe开发者_运维技巧r using following code. if(position==4) { Intent intent = new Intent();

I am calling one activity from anothe开发者_运维技巧r using following code.

if(position==4) {
  Intent intent = new Intent();
  intent.setClass(tlActivity, Income.class);
  startActivity(intent);
  finish();
}

but when i am into the second activity which is called. i can not return to previous activity from which activity 2 was called. is there any way i could return to the first activity by pressing back button. i am using 2.2 SDK

thanks in advance


It's because you are calling finish(). Take that line out if you want to be able to return to it.

0

精彩评论

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