私は、別のJsonリクエストでslidingTabLayoutを持っています。 これまで、私はそれぞれのpage_adapterごとに異なるクエリに基づいて異なるリクエストを得ることができました。 今私がしたいことは、アイテムをクリックするとarticle_layoutに送られますが、問題は私がonItemClickをどのように設定するのか分からないことです。ここonItemClick ListView、別のアダプタ
はjsonObjectのみhomeJSONAdapterに設定されているJSONObject jsonObject = (JSONObject) homeJSONAdapter.getItem(position);
ラインにおける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);
}
するためのコードです。どのような私が欲しいのかに基づいて様々なアダプタを持っているユーザーを表示するので、そのリストの記事
ポジションは、リストアイテムの位置を取得します。私は何のアイデアを持っているかを確認するために何か必要があると思いますか? – ddnice