title: Android ListView Get Item ID
body: <p>In the below code I am making a string array and splitting the string to strip out the IDs. Instead of this I want associative array so that I can select ID of the item from array. Can anyone help !</p>
  
  <pre><code>String[] data={"12__Item 1","14__Item 2","34__Item 3","56__Item 4"};
  lv = (ListView)findViewById(R.id.leaning_path_list_view);
  
  ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,R.layout.learning_path_single_row,R.id.textView,data);
      lv.setAdapter(adapter);
  
  
      lv.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
              String item =(String)parent.getItemAtPosition(position);
              String[] parts = item.split("__");
  
              Toast.makeText(getApplicationContext(),
                      "ID: " + parts[0]+" Title: " + parts[1], Toast.LENGTH_LONG)
                      .show();
  
  
          }
      });
  </code></pre>