The fragment which is got from backstack, call onCreateView() again

梦想的初衷 提交于 2019-12-05 05:35:10
AndroidHacker

check out my complete post over here Dynamically changing the fragments inside a fragment tab host?

As far your problem of reloading ( I assume ) you can do some thing like undermentioned:

(1) Initiate a Boolean value say

boolean android_hacker = false;

(2) Now say U need to fetch data and create some view using list view. Now at this stage set "android_hacker = true;" after you have fetched all data.

(3) Now when U again come back to same fragment say "FragmentA" then check value on OnCreateView as mentioned ..

if(android_hacker != true){
        new GoAsyncTask().execute();
        }else{
// Perform stuff U need
}

That's it. Hope it helps some one

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!