public Object getItem(int arg0) { try { return json.get(arg0); } catch (Exception e) { Logger.e(e.toString() + ""); return null; } }
public long getItemId(int arg0) { try { JSONObject obj = (JSONObject) json.get(arg0); id = obj.getInt("id"); return id; } catch (Exception e) { Logger.e(e.toString() + ""); return -1; } }
public View getView(final int index, View convertview, ViewGroup parent) { try { convertview = inflater.inflate(R.layout.task_list_rows, parent, false); TextView taskName = (TextView) convertview.findViewById(R.id.txt_task); ImageView leftIcon = (ImageView) convertview.findViewById(R.id.img_task); if (getCount() > 0) { taskName.setText(((JSONObject) getItem(index)).getString("title")); } } catch (Exception e) { Logger.e(e.toString() + ""); } return convertview; }