android - How to close one activity to another -
in android app have 2 activities, such activity , activity b. want close activity activity b activity a, tried code below, exception occurs,
a.this.finish();//to finish current activity works fine b.this.finish();//exception occurs because tried close activity class.
so how finish activity b activity a? guide me,
you need start activity b result , close when activity closing:
start of activity b:
intent = new intent(a.this, b.class); startactivityforresult(it, request_code); // request_code int value
finish of activity b:
finishactivity(request_code);
Comments
Post a Comment