Ejemplo n.º 1
0
 public void onStart() {
   if (serviceAdapter != null && serviceAdapter.getCount() > 0) {
     CommonAndroid.showView(false, loading);
   } else {
     CommonAndroid.showView(true, loading);
   }
 };
Ejemplo n.º 2
0
        public void onSucces(String response) {
          if (!isFinish()) {
            CommonAndroid.showView(false, loading);
            Log.i(TAG, "===> " + response);
            updateData();
            listObject = new ArrayList<ServiceList2Fragment.SeviceListObject>();
            try {
              JSONObject jsonRes = new JSONObject(response);
              JSONArray jsonArray = jsonRes.getJSONArray("data");
              for (int i = 0; i < jsonArray.length(); i++) {
                SeviceListObject obj = new SeviceListObject();
                JSONObject jobj = jsonArray.getJSONObject(i);
                obj.setId(jobj.getInt("id"));
                obj.setTitle(jobj.getString("title"));
                obj.setContent(jobj.getString("content"));
                obj.setSubTitle(jobj.getString("subtitle"));
                obj.setExternalUrl(jobj.getString("external_url"));
                obj.setSlug(jobj.getString("slug"));
                obj.setType(jobj.getString("type"));
                obj.setUrl(jobj.getString("url"));
                obj.setThumbnail(jobj.getString("thumbnail"));
                listObject.add(obj);
              }

              galleryAdapter = new GalleryAdapter(getActivity(), listObject);
              list.setAdapter(galleryAdapter);
              String parenTitle = jsonRes.getString("parent_title");
              txtTitleHeader.initHeader(parenTitle, parenTitle);
            } catch (Exception e) {
              // TODO: handle exception
            }
          }
        };
Ejemplo n.º 3
0
 public void onError(String message) {
   if (!isFinish()) {
     CommonAndroid.showView(false, loading);
   }
 };