我有一个产品的自定义 ListView。listview 的每一行都包含产品名称、图片、价格和描述。我想将列表视图的选定项目的标题、价格、描述和图像从当前的 ListView 活动传递到要显示的下一个活动。如何在意图中传递所选列表项的数据?
这是我的 java 文件中显示列表的代码的一部分:
private ArrayList<ThemeTourModel> GetThemeTourResults(){
ArrayList<ThemeTourModel> results = new ArrayList<ThemeTourModel>();
ThemeTourModel item_details = new ThemeTourModel();
item_details.settourname("Solo Woman Travellers");
item_details.settourDescription("Women searching the ultimate liberation may discover it in exploring the tourist destinations of world on their own. More freedom and security while traveling for leisurely getaways and adventures.");
item_details.setImageNumber(1);
item_details.setPrice("Rs.6999 - Rs.8999");
results.add(item_details);
return results;
}
public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {
// TODO Auto-generated method stub
if(position==0){
Intent i0 = new Intent(this,EnquireActivity.class);
startActivity(i0);
}