I am a newbie with programming Apps. Before asking this question I read several topics on StackOverflow but I can't find a solution.
My App has a Main Activity that immediately calls a "Second Activity" (I am trying a workaround for another problem I have) that would be the real "first page" (a Main Menu) of my application. So, here I set an Alert Dialog on my phone "Back Button" pressed asking "Are you sure you want to exit App?".
Now, I tried different solutions. One takes me to the Main Activity (a simple blank page), and ...
android.os.Process.killProcess(android.os.Process.myPid());
Will restart (I Think) my app, because after a few moments, I can see a blank page and again my "Second Activity" (Main Menu) as if It was called from Main Activity.
Is there a way to stop my APP without showing my hidden MainActivity or auto-restarting my App? Thanks! :)