title: Android : get the view position by a <key,value> pair
body: <p>In my app application i have an API that parsing <strong>JSON</strong> updating <strong>500 rows</strong> is the list view. In a row I have id,name,number and status. Through the pushnotification am getting an <strong>id</strong> out of the 500 and I want update the status of that id having row.</p>
  
  <p>Am using <strong>getter/setter</strong> method here so if getting the view position i can update the row.</p>
  
  <p>This is the way am parsing</p>
  
  <pre><code>for (int i = 0; i &lt; jsonArray.length(); i++) {
        JSONObject c = jsonArray.getJSONObject(i);
        String phone = c.getString("phone");
        String subDistributorStatus = c.getString("status");
        String name = c.getString("firstName");        
        subDistributerId = c.getString("subDistributerId");
  
        SubdistributorItem item = new SubdistributorItem();
        item.setSubDistributorName(name);
        item.setSubDistributorNumber(phone);
        item.setSubDistributorStatus(subDistributorStatus);
        item.setSubDistributorId(subDistributerId);
     }
  </code></pre>
  
  <p>This is the way am updating single row </p>
  
  <pre><code>SubdistributorItem subdistributorItem = subdistributorItemList.get(Integer.parseInt(getFromPreference("Sub_position")));  
  String phone= subdistributorItem.getSubDistributorNumber();
  String id= subdistributorItem.getSubDistributorId();
  String status= subdistributorItem.getSubDistributorStat
  </code></pre>
  
  <p>Here am getting the position by clicking the view. 
  Now if i get one of the <strong>id</strong> in the row  is there any chance to get the <strong>position</strong> in the view.</p>
  
  <p>I tried HashMap. </p>
  
  <p>**HashMap newmap = new HashMap(); // in global</p>
  
  <p>newmap.put(subDistributerId,i);  // in loop</p>
  
  <p>Log.e("Tag ","hash map positon "+ newmap.get(43)); // in onResume**</p>
  
  <p>But failed.</p>
  
  <p>can any please help to get the <strong>position</strong> of the <strong>row</strong> ,if get <strong>id</strong> of the row.</p>