use of org.flyve.mdm.agent.adapter.PoliciesAdapter in project android-mdm-agent by flyve-mdm.
the class FragmentPolicies method loadData.
private void loadData(ListView lst) {
List<Policies> arrPolicies = new PoliciesData(FragmentPolicies.this.getContext()).getAllPolicies();
ArrayList arr = new ArrayList<HashMap<String, Boolean>>();
if (arrPolicies.isEmpty()) {
HashMap<String, String> map = new HashMap<>();
map.put("description", "0 policies");
map.put("value", "");
map.put("taskId", "");
arr.add(map);
} else {
for (int i = 0; i < arrPolicies.size(); i++) {
HashMap<String, String> map = new HashMap<>();
map.put("description", Helpers.splitCapitalized(arrPolicies.get(i).policyName));
map.put("value", String.valueOf(arrPolicies.get(i).value));
map.put("taskId", String.valueOf(arrPolicies.get(i).taskId));
arr.add(map);
}
}
lst.setAdapter(new PoliciesAdapter(FragmentPolicies.this.getActivity(), arr));
}
Aggregations