📌  相关文章
📜  如何在 android studio 中导航到最后一个返回堆栈 - Kotlin 代码示例

📅  最后修改于: 2022-03-11 14:53:34.435000             🧑  作者: Mango

代码示例2
@Override
public void onBackPressed(){
    FragmentManager fm = getFragmentManager();
    if (fm.getBackStackEntryCount() > 0) {
        Log.i("MainActivity", "popping backstack");
        fm.popBackStack();
    } else {
        Log.i("MainActivity", "nothing on backstack, calling super");
        super.onBackPressed();  
    }
}