title: How to solve setOnItemClickListener() in two HortzListView from same activity been mixed up data transfer?
body: <p>I Have used two <code>HortzListView</code> from <code>androidq.jar</code> file, but the problem was it always resulted in mixed up data on <code>HortzListView.setOnItemClickListener()</code> when transferring data to other activity. I need a result to data transfer for which the item was clicked exactly. Any help would be appreciated. Thanks in Advance!</p>
  
  <pre><code>/* 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 &lt; ParseObject &gt; dealsQuery = new    ParseQuery(AppBazaarConstants.APP_BAZAAR_MAIN_PRODUCT);
  
  dealsQuery.whereEqualTo(AppBazaarConstants.CATEGORY,AppBazaarConstants.HOT_DEALS);
  
  dealsQuery.setLimit(4);
  dealsQuery.findInBackground(new FindCallback &lt; ParseObject &gt; () {...}
  
  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 &lt;? &gt; 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 &lt; ParseObject &gt; dealsQuery = new ParseQuery &lt;&gt; (AppBazaarConstants.APP_BAZAAR_MAIN_PRODUCT);
  
  
  dealsQuery.whereEqualTo(AppBazaarConstants.CATEGORY, AppBazaarConstants.NEW_DEALS);
  
  dealsQuery.setLimit(4);
  
  dealsQuery.findInBackground(new FindCallback &lt; ParseObject &gt; () {....}
  
  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 &lt;? &gt; 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);
      }
  </code></pre>