if (getSupportFragmentManager().getBackStackEntryCount() > 0) { //从返回栈中弹出当前的任务 getSupportFragmentManager().popBackStackImmediate(); }