Very simple code, but got error “Activity has been destroyed” when use Fragment

前端 未结 9 1135
误落风尘
误落风尘 2020-12-05 14:15

I made a very simple Activity which shows a simple ListFragment like below:

My Activity:

public class MyActivity ex         


        
9条回答
  •  伪装坚强ぢ
    2020-12-05 15:03

    what i did is immediately after commit i call

    fragmentManager.executePendingTransactions();

    and never try to commit after onpause() called

    Read this Artical Fragment Transactions & Activity State Loss

提交回复
热议问题