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

The following examples show how to use android.app.Activity#moveTaskToBack() . These examples are extracted from open source projects. 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
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
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 Project: Pioneer   File: Navigator.java    License: Apache License 2.0 4 votes vote down vote up
public static boolean moveToBackIfRoot(Activity activity) {
    return activity.moveTaskToBack(false);
}
 
Example 4
Source Project: Pioneer   File: Navigator.java    License: Apache License 2.0 4 votes vote down vote up
public static boolean moveToBackIfRoot(Activity activity) {
    return activity.moveTaskToBack(false);
}