Hi guys so I have this doubt. I've created an app that stores data in a SQLite and its displayed on a Listview in the Main Activity. What I'm trying to do is once I click one item from the list it should open an image from sd card. So my question is how can I use onClick here since I don't know the longitude of the list? And may I include the onclick for the list in the switch I've got?
UPDATED: I forgot to say that that I would like to open an image stored in the sdcard when I click a item of the list.
That's what I've got for now:
Contact_listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Cursor cursor = (Cursor) parent.getItemAtPosition(position);
String lat = cursor.getString(cursor.getColumnIndexOrThrow("lat"));
Toast.makeText(getApplicationContext(), lat, Toast.LENGTH_SHORT).show();
}
});
All comments or suggestions are welcomed. Thanks!