What I need basically is that when the user leaves the app for A or B reason to return to take me to the Login and not the screen where he stayed.
I put the attribute clearTaskOnLaunch
in true then I understand that the behavior should be that being in the activity MainActivity
, Main2Activity
, Main3Activity
if I go to the home or change the app when returning clean the backstack
and it is called the activity TimeOut
who is the one who has the attribute, but this behavior does not happen and always returns to activity
where it stayed.
This is my manifest, I do not know if I should configue something else to make it work:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mikemir.sessiontimeout">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<service
android:name=".Services.SessionService"
android:enabled="true"
android:exported="true" />
<activity android:name=".TimeOut"
android:clearTaskOnLaunch="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" />
<activity android:name=".Main2Activity" />
<activity android:name=".Main3Activity" />
</application>
</manifest>