Beispiel #1
0
    @Override
    protected void onPostExecute(JSONObject json) {
      ArrayList<HashMap<String, String>> lists;
      JSONArray jLists = null;

      try {
        int success = json.getInt(TAG_SUCCESS);
        if (success == 1) {
          jLists = json.getJSONArray(TAG_LISTS);

          for (int i = 0; i < jLists.length(); i++) {
            JSONObject c = jLists.getJSONObject(i);
            ListItem myitem = new ListItem();
            String lname = c.getString(TAG_LIST_NAME);
            Log.d("test", c.getString(TAG_LIST_NAME));
            String ldesc = c.getString(TAG_LIST_DESCRIPTION);
            forkey = Integer.parseInt(c.getString(TAG_LID));

            myitem.setDescription(ldesc);
            myitem.setName(lname);
            myitem.setListkey(forkey);

            // add item to list
            m_parts.add(myitem);
            m_adapter.notifyDataSetChanged();
          }
        }

      } catch (JSONException e) {
        e.printStackTrace();
      }
    }
Beispiel #2
0
        @Override
        public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
          ListItem myitem = new ListItem();
          myitem = m_parts.get(arg2);

          REMOVE = arg2;

          // gets list key from list

          forkey = myitem.getListkey();

          // remove item to list
          m_parts.remove(myitem);
          deleteList();
          return true;
        }
Beispiel #3
0
        @Override
        public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
          // TODO Auto-generated method stub

          ListItem myitem = new ListItem();
          myitem = m_parts.get(arg2);

          REMOVE = arg2;

          // gets list key from list

          int listkey = myitem.getListkey();

          Bundle mybundle = new Bundle();
          mybundle.putInt("listkey", listkey);

          Fragment newFragment = new Friend_Achievement_List_Fragment();
          newFragment.setArguments(mybundle);

          mActivity.pushFragments(AppConstants.TAB_F, newFragment, true, true);
        }