I have a service that is listening to some events. When that event happens, it shows a screen by startActivity(intent)
When the user finishes doing something on that screen, the code calls finish() but instead of 'closing' the complete application, it shows the main/launcher activity.
I mean, whats the best way to remove all app screens from current view? or any way to go around this?
The finish() method only finishes the Activity it's called from.
If you want the first Activity to be gone from the stack, you'll have to call finish on it right after you call startActivity(intent). This will remove the initial Activity from the stack, so the newly called Activity is the only one there and closing it will leave nothing behind.
The main activity has probably not finished and is therefore still in the stack of activities. I'm not sure about the right solution, but maybe this helps
http://developer.android.com/guide/topics/fundamentals.html#clearstack
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With