Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to use the finish() method in android [closed]

Tags:

android

I am a new beginner in android, so please tell me how to finish an activity in Android. I have already done one project. In this project, the previous activity was also working. So please tell me how to finish that activity when the next activity starts briefly.

Thanks in advance

like image 539
Ramakrishna Avatar asked Jan 04 '11 15:01

Ramakrishna


1 Answers

After I start the activity, I call the finish() method:

Intent i=new Intent(mainclass.this,nextclass.class);
startActivity(i);
finish();

Then the previous activity(mainclass) is finished.

like image 172
Ramakrishna Avatar answered Sep 23 '22 19:09

Ramakrishna