@Override public void onItemClick(AdapterView<?> list, View view, int position, long id) { if (list.getId() == android.R.id.list) { synchronized (RaceDatabase.class) { // they've selected something from our list DBPathEntry db = (DBPathEntry) list.getItemAtPosition(position); // the filename they want is GetParentPath + cs + ".wflp" String strFilename = MakeParentPath() + db.toString() + ".wflp"; File fPicked = new File(strFilename); if (fPicked.exists()) { AlertDialog ad = new AlertDialog.Builder(this).create(); ad.setMessage( "You are about to overwrite all your recorded race sessions. Data will be lost. Make sure to back them up using the save button (right side) first."); ad.setButton(AlertDialog.BUTTON_POSITIVE, "Ok", this); ad.setButton(AlertDialog.BUTTON_NEGATIVE, "Cancel", this); m_copyThis = fPicked; m_dbWarning = ad; ad.show(); } else { Toast.makeText(this, "Could not find file " + strFilename, Toast.LENGTH_LONG).show(); } } } }