There is an Activity that starts when the application starts.
<activity android:name=".activity.InitActivity" android:screenOrientation="portrait" android:theme="@style/AppTheme" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity>
After the necessary initialization, another MainActivity is started from it. When you click on the "Back" button, InitActivity returns from the back stack, although this should not happen. How to implement a similar functionality?
The search did not answer for my situation. android:noHistory="true"
parameter in the manifest is not appropriate, because In InitActivity, a request is made to get a geo-location, and if the GPS module is disabled, a dial-in window is called to turn it on, after it is closed, InitActivity is no longer in the back stack because of this parameter and the application simply exits.