Java Code Examples for android.app.Activity#moveTaskToBack()

The following examples show how to use android.app.Activity#moveTaskToBack() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PassCodeManager.java    From Cirrus_depricated with GNU General Public License v2.0 5 votes vote down vote up
public void onActivityStopped(Activity activity) {
    if (mVisibleActivitiesCounter > 0) {
        mVisibleActivitiesCounter--;
    }
    setUnlockTimestamp();
    PowerManager powerMgr = (PowerManager) activity.getSystemService(Context.POWER_SERVICE);
    if (passCodeIsEnabled() && powerMgr != null && !powerMgr.isScreenOn()) {
        activity.moveTaskToBack(true);
    }
}
 
Example 2
Source File: CommCareLifecycleUtils.java    From commcare-android with Apache License 2.0 5 votes vote down vote up
public static void restartCommCare(Activity originActivity, Class c, boolean systemExit) {
    Intent intent = new Intent(originActivity, c);

    // Make sure that the new stack starts with the given class, and clear everything between.
    intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);

    originActivity.moveTaskToBack(true);
    originActivity.startActivity(intent);
    originActivity.finish();

    if (systemExit) {
        System.exit(0);
    }
}
 
Example 3
Source File: Navigator.java    From Pioneer with Apache License 2.0 4 votes vote down vote up
public static boolean moveToBackIfRoot(Activity activity) {
    return activity.moveTaskToBack(false);
}
 
Example 4
Source File: Navigator.java    From Pioneer with Apache License 2.0 4 votes vote down vote up
public static boolean moveToBackIfRoot(Activity activity) {
    return activity.moveTaskToBack(false);
}