title: How to get list item position in list view?
body: <p>My code populates package names from a <code>.txt</code> file into a ListView, and I want to make every list item open itself in Google Play Store when clicked. How do I get the list item (package name)? </p>
  
  <pre><code>startActivity(new Intent(
              Intent.ACTION_VIEW,
              Uri.parse("http://play.google.com/store/apps/details?id="
                      + "com.utorrent.client")));
  </code></pre>
  
  <p>My list view:</p>
  
  <pre><code>    try {
          String filePath = Environment.getExternalStorageDirectory()
                  .getAbsolutePath() + "/vers.txt";
          BufferedReader br = new BufferedReader(new InputStreamReader(
                  new FileInputStream(filePath), "Cp1252"), 100);
  
          String line;
          ArrayList&lt;String&gt; lines = new ArrayList&lt;String&gt;();
          while ((line = br.readLine()) != null) {
              lines.add(line);
          }
  
          br.close();
  
          ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this,
                  android.R.layout.simple_list_item_1, lines);
  
          listView1.setAdapter(adapter);
  
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>