0

嗨,大家好我奮力2天一個循環視圖 我有一個片段包括回收觀點我在這個片段的對話片段和對話dissmissed回收視圖更新時,我想回收視圖不更新正確

這是ovvrerid上dissmiss方法在對話片段

somefragment fragment = new somefragment(); 
    var trance=Activity.SupportFragmentManager.BeginTransaction(); 
        trance.Detach(fragment); 
        trance.Attach(fragment); 
        trance.Commit(); 

之後,我得到的OnStart新的數據,並把它再次適配器,在我與斷點檢查每一件事情是好的,但仍回收劑量不會更新

list = await DownloadDataFromServer<List<Cilinic>>(uri + Handel.CurrentCityId); 

     myAdapter = new RecyclerAdapter(list); 
     myRecyclerView.SetAdapter(myAdapter); 
      myAdapter.NotifyDataSetChanged(); 

請幫我

+0

你在代碼中使用的LayoutManager? –

+0

爲什麼你創建你的片段的新實例?你不能直接更新適配器的重寫解僱方法的片段? –

+0

不在dissmiss是在另一個對話框片段,我不能更新我的主要片段中的回收視圖 –

回答

0

嘗試增加給你的代碼

RecyclerView.LayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext()); 
    myRecyclerView.setLayoutManager(mLayoutManager); 
    myRecyclerView.setItemAnimator(new DefaultItemAnimator()); 
+0

感謝您的迴應,但仍然無法正常工作! –

+0

是列表中的數據? –

+0

是的,我檢查了它的斷點,我的數據在那裏,但沒有發生! –