Reputation: 9
I am new to android...I want to move back to the previous screen when i pressed some button in current screen..how can we implement? ... Thanks in advance
Upvotes: 0
Views: 350
Reputation: 3743
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);
Upvotes: 0
Reputation: 4719
To end the current activity and go to the previous activity you can just call finish()
Upvotes: 3