use of org.flyve.mdm.agent.adapter.TopicsAdapter in project android-mdm-agent by flyve-mdm.
the class FragmentTopics method loadData.
private void loadData(ListView lst) {
List<Topics> arrTopics = new TopicsData(FragmentTopics.this.getContext()).getAllTopics();
ArrayList arr = new ArrayList<HashMap<String, Boolean>>();
if (arrTopics.isEmpty()) {
HashMap<String, String> map = new HashMap<>();
map.put("topic", "");
map.put("status", "");
arr.add(map);
} else {
for (int i = 0; i < arrTopics.size(); i++) {
HashMap<String, String> map = new HashMap<>();
map.put("topic", String.valueOf(arrTopics.get(i).topic));
map.put("status", String.valueOf(arrTopics.get(i).status));
arr.add(map);
}
}
lst.setAdapter(new TopicsAdapter(FragmentTopics.this.getActivity(), arr));
}
Aggregations