Search in sources :

Example 1 with TopicsAdapter

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));
}
Also used : Topics(org.flyve.mdm.agent.data.database.entity.Topics) TopicsData(org.flyve.mdm.agent.data.database.TopicsData) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) TopicsAdapter(org.flyve.mdm.agent.adapter.TopicsAdapter)

Aggregations

ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 TopicsAdapter (org.flyve.mdm.agent.adapter.TopicsAdapter)1 TopicsData (org.flyve.mdm.agent.data.database.TopicsData)1 Topics (org.flyve.mdm.agent.data.database.entity.Topics)1