Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void onPostExecute(String a) {
- if(isCancelled()) return;
- String[] titles = freader.getList();
- String[] images = freader.getimages();
- if (titles.length>0){
- // This code only runs when there's a result (AKA, network available)
- // It updates - if the above IF statement returns 0, it will use the available cache.
- SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mCont);
- Editor editor = prefs.edit();
- editor.putString(cache1, implodeArray(titles,"SEPAPPCONSTRUCTORSEP"));
- editor.putString(cache2, implodeArray(freader.getDescriptions(),"SEPAPPCONSTRUCTORSEP"));
- editor.putString(cache3, implodeArray(images,"SEPAPPCONSTRUCTORSEP"));
- editor.putString(cache4, implodeArray(freader.getarg2(),"SEPAPPCONSTRUCTORSEP"));
- editor.commit();
- if (feedArgs[0].matches(".*api.twitter.*")){
- mContext.setListAdapter(new ArrayAdapter<String>(mCont,
- R.layout.list_item_twitter,R.id.list_content, titles));
- }else{
- if (tListImage){
- ImageLoader imageLoader = ImageLoader.getInstance();
- imageLoader.init(ImageLoaderConfiguration.createDefault(mCont));
- Core x = new Core();
- listAdapter la = x.new listAdapter();
- la.initialize(titles,images,mContext,mContext.getActivity());
- mContext.setListAdapter(la);
- }else{
- mContext.setListAdapter(new ArrayAdapter<String>(mCont,
- android.R.layout.simple_list_item_1, titles));
- }
- }
- }
- mContext.getSherlockActivity().setSupportProgressBarIndeterminateVisibility(false);
- }
Advertisement
Add Comment
Please, Sign In to add comment