KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Seems the refresh issue is discussed before, but none of the solutions worked for me. What I am trying to do: I am using FragmentStatePagerAdapter. Each position of the adapter holds a fragment that has a linear layout that has chess like appearance, with each cell represented by a CheckedTextView. And a listener that should listens for clicks and removes the previous selection on the cells and makes the new selection. Whats working: Each fragment is loaded correctly with all the data/default states (calculated while the fragment is loaded in a list) When I click a cell all the states from the saved cells list are fetched correctly and I can change see the state change in the code while debugging. At the same time I assign a new state for the CheckedTextView which represent a cell. This is set like: CheckedTextView cellView = (CheckedTextView) GridRow.getChildAt(c); cellView.setSelected(false); cellView.setChecked(false); cellView.setTag(cellsChess.get(i).get(c)); The Issue: Even though the values are stored and assigned correctly the view can't be refreshed the values of the cells in the view do not get updated. Tips I have Tried that didn't worked: 1. Call adapter.notifyDataSetChanged: Can be called while using FragmentStatePagerAdapter only when we have overridden: @Override public int getItemPosition(Object object){ return POSITION_NONE; } 2. Adding Overriden methods for DestroyItem and also adding the fragments to a Map on getItem: This is not appropriate as I am working with FragmentStatePagerAdapter, so the whole purpose of using this pagerAdapter would be gone. 3. Calling invalidate: This is inappropriate for this scenario, I nee
Tags (comma-separated)
Save Edits
Cancel