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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -