I am trying to create a list view for a password manger which will populate a listview with items from Database and when someone clicks it will return the primaryid.... I have seen other examples but not able to get it done corectly.... Here's what I have done so far.... I am able to Populate the List View but not able to handle on click events :(

```
    ArrayList<String> listItems=new ArrayList<String>();
    ArrayAdapter<String> adapter=new ArrayAdapter<String>(this,android.R.layout.simple_list_item_single_choice , listItems);

    SQLiteDatabase DB= null;
     final String TableName = "XIBEAT_PASSWORDS";
     String DBname="Xibeat_Crypto_Knight_Vault";
    try {
        DB = this.openOrCreateDatabase(DBname, MODE_PRIVATE, null);
        DB.execSQL("CREATE TABLE IF NOT EXISTS " + TableName + " ('_id' INTEGER PRIMARY KEY AUTOINCREMENT,HOST TEXT, URL TEXT, PASSWORD TEXT, NOTES TEXT, TAG TEXT, TIME TEXT, DATE TEXT, EXPIRE TEXT, EDITED TEXT, STRENGTH TEXT, REASON TEXT);");

           Cursor c = DB.rawQuery("SELECT * FROM " + TableName , null);

           int host= c.getColumnIndex("HOST");

           String title="";
           c.moveToFirst();
        if(c!=null)
        {
        while (c.moveToNext()){
                    title = c.getString(host);
                    //Toast(title);
                    listItems.add(title);

        }
        }  

        final ListView passList=(ListView)findViewById(R.id.passlist);
        passList.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, listItems));
        //===============ONCLICK LISTENER+=========
        passList.setOnItemClickListener(new OnItemClickListener() 
        {public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long arg3) {

        }});            

          } finally {
           if (DB != null)
            DB.close();
          }

}

```