Code

Code

Move the task containing this activity to the back of the activity

public boolean moveTaskToBack(boolean nonRoot) {
    try {
        return ActivityManagerNative.getDefault().moveActivityTaskToBack(
                mToken, nonRoot);
    } catch (RemoteException e) {
        // Empty
    }
    return false;
}

Just use this.
moveTaskToBack(true);