 <pre><code> YourListView.setOnItemClickListener(new ListView.OnItemClickListener() { @Override public void onItemClick(AdapterView&lt;?&gt; a, View v, int pos, long l) { try { Toast.makeText(this,"Position is===&gt;&gt;"+pos , Toast.LENGTH_LONG).show(); } catch(Exception e) { System.out.println("Nay, cannot get the selected index"); } } }); </code></pre> <p>Hope it helps.</p>