Configure with your activity using:
android:alwaysRetainTaskState="true"
and:
android:launchMode="singleTask" //(preffered, or "singleInstance")
For example:
//In the manifest file you have to add these.
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:alwaysRetainTaskState="true"
android:launchMode="singleTask"> </activity>