2015-12-14 41 views
0

transaction.addToBackStack(null)沒有意義?transaction.addToBackStack(null)沒有意義

我的程序設置爲按下按鈕,並添加片段前: enter image description here 壓後: enter image description here

我的代碼是:

anotherFragment anotherFragment = new anotherFragment(); 
    android.app.FragmentManager fragmentManager = getFragmentManager(); 
    FragmentTransaction transaction = fragmentManager.beginTransaction(); 
    transaction.replace(R.id.right_container,anotherFragment); 
    transaction.addToBackStack(null); 
    transaction.commit(); 

有什麼不對?

回答

0

我認爲這可能是Genymotion的bug

serveral的分鐘後,我重新啓動它在genymotion模擬器。有用!