{"action":"created","issue":{"url":"https://api.github.com/repos/emilsjolander/android-FlipView/issues/62","labels_url":"https://api.github.com/repos/emilsjolander/android-FlipView/issues/62/labels{/name}","comments_url":"https://api.github.com/repos/emilsjolander/android-FlipView/issues/62/comments","events_url":"https://api.github.com/repos/emilsjolander/android-FlipView/issues/62/events","html_url":"https://github.com/emilsjolander/android-FlipView/issues/62","id":97717323,"number":62,"title":"FlipView Adapter not Updating","user":{"login":"Omalicha","id":13289217,"avatar_url":"https://avatars.githubusercontent.com/u/13289217?v=3","gravatar_id":"","url":"https://api.github.com/users/Omalicha","html_url":"https://github.com/Omalicha","followers_url":"https://api.github.com/users/Omalicha/followers","following_url":"https://api.github.com/users/Omalicha/following{/other_user}","gists_url":"https://api.github.com/users/Omalicha/gists{/gist_id}","starred_url":"https://api.github.com/users/Omalicha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Omalicha/subscriptions","organizations_url":"https://api.github.com/users/Omalicha/orgs","repos_url":"https://api.github.com/users/Omalicha/repos","events_url":"https://api.github.com/users/Omalicha/events{/privacy}","received_events_url":"https://api.github.com/users/Omalicha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-28T14:16:13Z","updated_at":"2015-07-28T15:10:21Z","closed_at":null,"body":"The adapter of a flipview is set onCreate. Everything works fine. The user is meant to select some items on another activity which would update the items on the flipview. I implemented this by changing the adapter of the flipView when onResume is called and the dismiss activity is the selectionActivity. The code is executed but it does not reflect on the flipView items.\r\n\r\nWhat i do on onCreate\r\n\r\n @Override\r\n             'public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,@Nullable\r\nBundle savedInstanceState) {\r\n            super.onCreate(savedInstanceState);\r\n            View rootView = inflater.inflate(R.layout.flip_main, container, false);\r\n            mFlipView = (FlipView) rootView.findViewById(R.id.flip_view);\r\n\r\n            mAdapter = new FlipAdapter(getActivity(),getHomeItems(), getFragmentManager());\r\n            mAdapter.setCallback(this);\r\n            mFlipView.setAdapter(mAdapter);\r\n            mFlipView.setOnFlipListener(this);\r\n            if (isFirstShown) {\r\n                mFlipView.peakNext(false);\r\n                isFirstShown = false;\r\n            }\r\n            mFlipView.setOverFlipMode(OverFlipMode.RUBBER_BAND);\r\n            mFlipView.setEmptyView(getActivity().findViewById(R.id.empty_view));\r\n            mFlipView.setOnOverFlipListener(this);\r\n            return rootView;\r\n        }\r\n\r\nwhat is called after the user makes selection\r\n\r\nFlipAdapterTest mAdapter = new FlipAdapterTest(getActivity(), getHomeItems(), getFragmentManager());\r\n    mFlipView.removeAllViews();\r\n    mFlipView.setAdapter(mAdapter);"},"comment":{"url":"https://api.github.com/repos/emilsjolander/android-FlipView/issues/comments/125643190","html_url":"https://github.com/emilsjolander/android-FlipView/issues/62#issuecomment-125643190","issue_url":"https://api.github.com/repos/emilsjolander/android-FlipView/issues/62","id":125643190,"user":{"login":"ayltai","id":5842459,"avatar_url":"https://avatars.githubusercontent.com/u/5842459?v=3","gravatar_id":"","url":"https://api.github.com/users/ayltai","html_url":"https://github.com/ayltai","followers_url":"https://api.github.com/users/ayltai/followers","following_url":"https://api.github.com/users/ayltai/following{/other_user}","gists_url":"https://api.github.com/users/ayltai/gists{/gist_id}","starred_url":"https://api.github.com/users/ayltai/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ayltai/subscriptions","organizations_url":"https://api.github.com/users/ayltai/orgs","repos_url":"https://api.github.com/users/ayltai/repos","events_url":"https://api.github.com/users/ayltai/events{/privacy}","received_events_url":"https://api.github.com/users/ayltai/received_events","type":"User","site_admin":false},"created_at":"2015-07-28T15:10:21Z","updated_at":"2015-07-28T15:10:21Z","body":"Is it possible that your fragment is being created again when your main activity resumes, such that `onCreateView()` is called and `mFlipView` is re-created? Can you post the code you use to create and add your fragment?\r\n\r\nBTW, why are you calling `super.onCreate()` in `onCreateView()`? And, you don't need to call `mFlipView.removeAllViews()`, because it will be called in `mFlipView.setAdapter()`."}}