ok I’ve search all over the web for a solution to this.
I’m a newbie so please bear with me.
I have a application that requires a user to agree to a EULA which is a activity that I created. I have a accept and cancel button, when the accept button is pressed it stores data inside the sharedpreference to say that it was accepted.
My problem comes in on the cancel button. If I use a dialog instead of a activity it works fine with finish(); as it closes the app. but if I use the cancel button on the activity it closes that activity and proceeds to access the rest of the app.
What is the best way to tell my button that the app should be closed if the user does not accept the EULA.
Use setResult in your EULA activity to return data to previous activity and then use onActivityResult in your previous activity to check if user picked Accept or Cancel, and accordingly call
finish()method on it.