Don’t use System.exit
.
If you want user to close app from any Activity
I suggest using startActivityForResult
, checking returned value in onActivityResult
in first Activity
and calling finish()
there too.
More Related Contents:
- how to send string from one activity to another without starting second activity [duplicate]
- How to send an object from one Android Activity to another using Intents?
- How to handle screen orientation change when progress dialog and background thread active?
- Close application and launch home screen on Android
- What does @hide mean in the Android source code?
- Can I create an object of an Activity in other class?
- How to send string from one activity to another?
- How do I pass data between Activities in Android application?
- Activity, AppCompatActivity, FragmentActivity, and ActionBarActivity: When to Use Which?
- Passing Data Between Fragments to Activity
- Android singleTask or singleInstance launch mode? [closed]
- How to pass the values from one activity to previous activity
- Android: how do I check if activity is running?
- Programmatically update widget from activity/service/receiver
- How to display progress dialog before starting an activity in Android?
- Android. Fragment getActivity() sometimes returns null
- how to call a method in another Activity from Activity
- New Intent() starts new instance with Android: launchMode=”singleTop”
- Android : Static Fields and Memory Leaks
- Two launcher activities
- Start an activity from a fragment
- Start Activity inside onReceive BroadcastReceiver
- Start Activity with an animation
- Cannot call getSupportFragmentManager() from activity
- Passing strings between activities in android
- When exactly are onSaveInstanceState() and onRestoreInstanceState() called?
- Activity.finish() called but activity stays loaded in memory
- Android 4.4.2 – java.lang.RuntimeException: Performing stop of activity that is not resumed
- onActivityResult With launchMode=”singleTask”?
- How can I configure Launcher activity programmatically in android?