I have slidingTabLayout, with different Json request. Until now i have managed to get for each page_adapter the different requests based on different queries. What i want to do now, is when i click on the item, it sends me to the article_layout, but the problem is i dont know how to set the onItemClick, to different views.
Here is the code for the onItemClick
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
JSONObject jsonObject = (JSONObject) homeJSONAdapter.getItem(position);
String imageURL = jsonObject.optString("image_url");
String Text1 = jsonObject.optJSONObject("content").optString("rendered");
String text2 = jsonObject.optJSONObject("title").optString("rendered");
Intent detailIntent = new Intent(getActivity(), SingleArticle.class);
detailIntent.putExtra("imgURL", imageURL);
detailIntent.putExtra("articleText", Text1);
detailIntent.putExtra("articleTitle", Text2);
startActivity(detailIntent);
}
in the line JSONObject jsonObject = (JSONObject) homeJSONAdapter.getItem(position);
the jsonObject is set only to homeJSONAdapter. What i want is to have different adapters based on which view the user is, so to read the article of that list