Android 如何解决同一活动中两个HortzListView中的setOnItemClickListener()数据传输混淆的问题?
我使用了Android 如何解决同一活动中两个HortzListView中的setOnItemClickListener()数据传输混淆的问题?,android,android-intent,parse-platform,Android,Android Intent,Parse Platform,我使用了androidq.jar文件中的两个HortzListView,但问题是在将数据传输到其他活动时,它总是导致HortzListView.setOnItemClickListener()上的数据混淆。我需要一个数据传输的结果,该项目被完全点击。任何帮助都将不胜感激。提前谢谢 /* Deals Horizontal list view initiation * / HorzListView hotDealsListView, newDealsListView; hotDeal
androidq.jar
文件中的两个HortzListView
,但问题是在将数据传输到其他活动时,它总是导致HortzListView.setOnItemClickListener()
上的数据混淆。我需要一个数据传输的结果,该项目被完全点击。任何帮助都将不胜感激。提前谢谢
/* Deals Horizontal list view initiation * /
HorzListView hotDealsListView, newDealsListView;
hotDealsListView = (HorzListView) findViewById(R.id.hotDealsList);
newDealsListView = (HorzListView) findViewById(R.id.newDealsList);
if (CheckNetworkConnection.isOnline(this)) {
ParseQuery < ParseObject > dealsQuery = new ParseQuery(AppBazaarConstants.APP_BAZAAR_MAIN_PRODUCT);
dealsQuery.whereEqualTo(AppBazaarConstants.CATEGORY,AppBazaarConstants.HOT_DEALS);
dealsQuery.setLimit(4);
dealsQuery.findInBackground(new FindCallback < ParseObject > () {...}
dealsAdapter = new DealsAdapter(HomeActivity.this, R.layout.deals_single_item, dealsArrayList);
hotDealsListView.setAdapter(dealsAdapter);
/*Intent with this item ClickListener Indication 1*/
/*************** Problem or Indication 1 ******************************/
hotDealsListView.setOnItemClickListener(new
AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView <? > parent, View view, int position, long id) {
simpleCatgoryUtil = dealsArrayList.get(position);
intent = new Intent(HomeActivity.this, DealsDetailActivity.class); switchDeals(HomeActivity.this,intent,simpleCatgoryUtil);
}
else {
Message.messageShort(HomeActivity.this, "No HotDeals Product Available");
}
} else {
Message.messageShort(HomeActivity.this, e.getMessage());
}
}
});
} else {
Message.messageAlert(this, AppBazaarConstants.OK, AppBazaarConstants.CHECK_FOR_NETWORK_CONNECTION);
}
if (CheckNetworkConnection.isOnline(this)) {
ParseQuery < ParseObject > dealsQuery = new ParseQuery <> (AppBazaarConstants.APP_BAZAAR_MAIN_PRODUCT);
dealsQuery.whereEqualTo(AppBazaarConstants.CATEGORY, AppBazaarConstants.NEW_DEALS);
dealsQuery.setLimit(4);
dealsQuery.findInBackground(new FindCallback < ParseObject > () {....}
dealsAdapter = new DealsAdapter(HomeActivity.this, R.layout.deals_single_item, dealsArrayList);
newDealsListView.setAdapter(dealsAdapter);
/*Intent with this item ClickListener Indication 2*/
/****************** Problem Or Indicator 2 *******************************/
newDealsListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView <? > parent, View view, int position, long id) {
simpleCatgoryUtil = dealsArrayList.get(position);
intent = new Intent(HomeActivity.this, DealsDetailActivity.class); switchDeals(HomeActivity.this,intent,simpleCatgoryUtil);
}
});
} else {
Message.messageShort(HomeActivity.this, "No HotDeals Product Available");
}
} else {
Message.messageShort(HomeActivity.this, e.getMessage());
}
}
});
} else {
Message.messageAlert(this, AppBazaarConstants.OK, AppBazaarConstants.CHECK_FOR_NETWORK_CONNECTION);
}
/*This is the common method*/
/*Indication 1 and Indication 2 item clicklistner data get mixed up*/
private static void switchDeals(Context context ,Intent intent ,
SimpleCatgoryUtil simpleCatgoryUtil){
intent.putExtra( AppBazaarConstants.OBJECT_ID, simpleCatgoryUtil.getObjectId());
intent.putExtra(AppBazaarConstants.PRODUCT, simpleCatgoryUtil.getProduct());................
context.startActivity(intent);
}
/*处理水平列表视图启动*/
HorzListView hotDealsListView、newDealsListView;
hotDealsListView=(HorzListView)findViewById(R.id.hotDealsList);
newDealsListView=(HorzListView)findViewById(R.id.newDealsList);
if(检查networkconnection.isOnline(此)){
ParseQuerydealsQuery=新的ParseQuery(AppBazaarConstants.APP_BAZAAR_MAIN_PRODUCT);
dealsQuery.whereEqualTo(AppBazaarConstants.CATEGORY,AppBazaarConstants.HOT_DEALS);
交易限额(4);
findInBackground(新的FindCallback(){…}
dealsAdapter=新的dealsAdapter(HomeActivity.this,R.layout.deals\u single\u item,dealsArrayList);
setAdapter(dealsdapter);
/*使用此项的意图单击侦听器指示1*/
/***************问题或迹象1******************************/
hotDealsListView.setOnItemClickListener(新建)
AdapterView.OnItemClickListener(){
@凌驾
public void Onite McClick(AdapterView Good lord,请对此进行编辑(格式化)并澄清您的问题。@Ascorbin我继续并修复了代码格式。(“现在是哪一年?”)我的编辑当前正在等待审核。>水平列表视图HorzListView hotDealsListView、newDealsListView;问题或指标1和问题或指标2以及常用方法是代码中真正的问题部分