System.Exit(0) Doesnt Close All My Activities

Force quit of Android App using System.exit(0) doesn't work

The Exit is possible by deleting the whole activity-call-history and starting the Home-Activity of the Home-Scrren.

Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(intent);

Android application doesn't close after calling System.exit(0)

I have found out some facts. If the application is terminated by System.exit(0) or by android.os.Process.killProcess the next time AdMob won't show ads. Even more if you try to terminate application it will stuck (the process remain active and the only option to kill it is the device reboot). The only solution is not to use System.exit(0) to exit application. It should be mentioned that it does not matter whether adView.destroy() or adView.stopLoading() was called.

I used this.moveTaskToBack(true); instead of termination. It will hide the application and if in some time it won't get restored Android will release all resources and AdMob will work OK. If the application will be restored it will continue from the same place.

system.exit(0) returned to the previous screen not closing the entire app on single click

In your Manifest.xml, you should add android:noHistory="true" in your <activity> tags.
Additionally, you should not call system.exit(0), but instead just use finish().

By doing this, the activities will not be added to the back stack, and therefore, pressing the exit button (or the back button) will let the user exit the app.

Android doesn't close on System.exit()

finish() Launcher activity when rise this activity
then you dont need write anycode onBackPresed

read this post for close app: Is quitting an application frowned upon?



Related Topics



Leave a reply



Submit