I was able to feed my listview with SQLite data, however, I now want to capture the data (in the database) that each row in the listview matches.
For example:
Line 10 displays Code 1 and Name: Philip
Line 13 displays Code 4 and Name: Giovana
For example, there are 2 rows in the list, the method I was able to use, returned a String with the complete line. As soon as I click on a row in the listview, I want it to return the code (Cod.4, for example) that is being shown in the String stored in the adapter. For example, I want to click on line 10 and let me know that the data it is displaying corresponds to the bank's code 1 record.
Since there are 2 columns that are being displayed, I want a way to capture them separately.
I'm feeding lisview like this:
while(data.moveToNext()){
//coluna 1 do banco
theList.add("Cód.: " + data.getString(0) + " " + "Nome: " + data.getString(1));
ListAdapter listAdapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, theList);
listView.setAdapter(listAdapter);
}