LoopView - Does not work with dynamic values from server
codebreaker9904 opened this issue · 0 comments
codebreaker9904 commented
LoopView is not refreshing itself:
- Never shows rows in loopview, when i pass a arraylist from server, after fetching it.
- Once i put app in background and bring it back, it shows the rows.
P.S: I tried invalidate() , postinvalidate() , recreate() . Nothing works.
Below is my code:
public void refreshcategoryloop(){
categoryLoop = (LoopView)findViewById(R.id.categoryLoop);
categoryView.setVisibility(View.VISIBLE);
categoryLoop.setInitPosition(0);
categoryLoop.setCanLoop(false);
categoryLoop.setLoopListener(new LoopScrollListener() {
@Override
public void onItemSelect(int item) {
}
});
categoryLoop.setTextSize(15);
categories = new ArrayList<String>();
for (int l = 0; l < servicesArr.length(); l++) {
try {
categories.add(servicesArr.getJSONObject(l).getString("Performance").toString());
} catch (JSONException e) {
e.printStackTrace();
}
}
categoryLoop.setDataList(categories);
}