Duveaux

Untitled

Oct 30th, 2012
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.77 KB | None | 0 0
  1.         @Override
  2.         protected void onPostExecute(String a) {
  3.             if(isCancelled()) return;
  4.             String[] titles = freader.getList();
  5.             String[] images = freader.getimages();
  6.             if (titles.length>0){
  7.                 // This code only runs when there's a result (AKA, network available)
  8.                 // It updates - if the above IF statement returns 0, it will use the available cache.
  9.             SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mCont);
  10.             Editor editor = prefs.edit();
  11.             editor.putString(cache1, implodeArray(titles,"SEPAPPCONSTRUCTORSEP"));
  12.             editor.putString(cache2, implodeArray(freader.getDescriptions(),"SEPAPPCONSTRUCTORSEP"));
  13.             editor.putString(cache3, implodeArray(images,"SEPAPPCONSTRUCTORSEP"));
  14.             editor.putString(cache4, implodeArray(freader.getarg2(),"SEPAPPCONSTRUCTORSEP"));
  15.             editor.commit();
  16.             if (feedArgs[0].matches(".*api.twitter.*")){
  17.             mContext.setListAdapter(new ArrayAdapter<String>(mCont,
  18.                     R.layout.list_item_twitter,R.id.list_content, titles));
  19.             }else{
  20.                 if (tListImage){
  21.                     ImageLoader imageLoader = ImageLoader.getInstance();
  22.                     imageLoader.init(ImageLoaderConfiguration.createDefault(mCont));
  23.  
  24.                 Core x = new Core();
  25.                 listAdapter la = x.new listAdapter();
  26.                 la.initialize(titles,images,mContext,mContext.getActivity());
  27.                 mContext.setListAdapter(la);
  28.                 }else{
  29.                     mContext.setListAdapter(new ArrayAdapter<String>(mCont,
  30.                             android.R.layout.simple_list_item_1, titles));
  31.                 }
  32.             }
  33.         }
  34.             mContext.getSherlockActivity().setSupportProgressBarIndeterminateVisibility(false);
  35.  
  36.             }
Advertisement
Add Comment
Please, Sign In to add comment