I have an app with a side menu. The doubt I have is that every time I use one of the menu options it opens a new window.
} else if (id == R.id.cine) {
Intent intent = new Intent(this.getApplication(), Cine.class);
startActivityForResult(intent, 0);
finish();
So far so good, but I have the doubt that I have put the finish to close the previous window.
But I don't like how it looks since I would like to be able to go back to the previous one by giving it back without it being closed. But if I remove the finish then it opens windows and it's like many applications open.
Is there any way to do it ?
Thank you!
If the requirement is to use activities, it actually only opens the Activity (no need to use
startActivityForResul()
), to allow only one instance of the Activity define for each Activity within your AndroidManifest.xml, the property:the main Activity do not finish it, with this when you return, your main Activity will remain open.