Skip to content Skip to sidebar Skip to footer

How To Update Fragment Pager Adapter From Fragments?

Problem :: I have one SherlockFragmentActivity in which i have added six fragments. Now out of six 3 fragments are added based on the conditions. loading the fragments :: private

Solution 1:

From the exception, it looks like you are trying to perform a UI application in a non-UI thread, which is forbidden. Try to encapsulate your UI code (especially TestActivity.java:238) with this :

MenuInterface mInterface=new MenuInterface() {
    @Override
    public void loadMenu() {
        getActivity().runOnUiThread(new Runnable() {
            public void run() {
                loadFragments();
            }
        });
    }
};

Post a Comment for "How To Update Fragment Pager Adapter From Fragments?"