0
In my application, I have two Fragments, one to load Tweets and one to Read an RSS. RSS
public class RssFragment extends ListFragment {
private RssListAdapter adapter;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
List<JSONObject> jobs = new ArrayList<JSONObject>();
try {
jobs = RssReader.getLatestRssFeed();
} catch (Exception e) {
Log.e("RSS ERROR", "Error loading RSS Feed Stream >> " + e.getMessage() + " //" + e.toString());
}
adapter = new RssListAdapter(getActivity(),jobs);
setListAdapter(adapter);
return super.onCreateView(inflater, container, savedInstanceState);
}
Tweets
public class Noticias extends ListFragment {
final static String twitterScreenName = "";
final static String TWITTER_API_KEY = "";
final static String TWITTER_API_SECRET = "";
private static final String TAG = "Tweet";
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
//new CustomToast(getActivity(), numbers_digits[(int) id]);
}
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.permitNetwork()
.build());
ArrayList<TwitterTweet> twitterTweets = null;
TwitterAPI twitterAPI = new TwitterAPI(TWITTER_API_KEY,TWITTER_API_SECRET);
twitterTweets = twitterAPI.getTwitterTweets("LinkOffTMMG");
ArrayAdapter<TwitterTweet> adapter = new ArrayAdapter<TwitterTweet>(
inflater.getContext(), R.layout.twitter_tweets_list,
R.id.listTextView, twitterTweets);
setListAdapter(adapter);
return super.onCreateView(inflater, container, savedInstanceState);
}
}
How do I create another Fragment by joining the content of the other two ordered by the latest date?
My suggestion would be to create a
Adapter
customized (subclass of Basedapter) with access to these two Dataset’s to show off the two.– Wakim
But how do I get more than one guy on a Basedapter?
– Lucas
I believe you will have to create a class that implements the logic of merge. Implementing the abstract methods of the `Basedapter class.
– Wakim