Back to project page test-gradle.
The source code is released under:
Copyright (c) <2013> <Paul Estrada> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the S...
If you think the Android project test-gradle listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.listexample.utils; /*from w w w . j a v a 2 s . co m*/ import java.util.ArrayList; import java.util.List; import android.os.AsyncTask; import com.example.listexample.MyAdapter; public class GetTweetsTask extends AsyncTask<String, Integer, List<Tweet>> { private MyAdapter myAdapter = null; public void setAdapter(MyAdapter myAdapter) { this.myAdapter = myAdapter; } @Override protected List<Tweet> doInBackground(String... params) { List<Tweet> tweets = null; if (params != null && params.length > 0) { try { String url = params[0]; String jsonString = HttpUtils.connect(url, null); tweets = JsonParser.parseTwitterTimeline(jsonString); } catch(Exception e) { e.printStackTrace(); tweets = new ArrayList<Tweet>(); } } else { tweets = new ArrayList<Tweet>(); } return tweets; } @Override protected void onPostExecute(List<Tweet> result) { myAdapter.addElements(result); } }