The implementation seems to be, as always, typical, but the cursor stubbornly does not want to find data on the registration of a click on an element. It passes the correct position (from 0 and up to the list items) and then simply finds 0 items. Base initialized and correctly filled. Tell me, what could be the error?
listViewPasswords.setOnItemClickListener(new AdapterView.OnItemClickListener() { Bundle tempBundle = new Bundle(); @Override public void onItemClick(AdapterView<?> listView, View v, int position, long id) { //Π±ΡΠ°ΡΡ Position Π΄Π»Ρ ΠΈΠ΄Π΅Π½ΡΠΈΡΠΈΠΊΠ°ΡΠΈΠΈ Π½ΠΎΠΌΠ΅ΡΠ° ΠΏΠ°ΡΠΎΠ»Ρ! DialogFragment dialogShowPass = new DetailedPassFragment(); //ΠΈΠ½ΠΈΡΠΈΠ°Π»ΠΈΠ·ΠΈΡΡΠ΅ΠΌ ΡΡΠ°Π³ΠΌΠ΅Π½Ρ ShowPass PasswordDatabaseHelper helper = new PasswordDatabaseHelper(MainActivity.this); SQLiteDatabase dbShowPass = helper.getReadableDatabase(); Cursor cursorShowPass = dbShowPass.query("DATAPASS", new String[]{"SITE", "PASS", "INFO"}, "_id = ?", new String[]{Integer.toString(position)}, null, null, null); if(cursorShowPass.moveToFirst()) { tempBundle.putString("site", cursorShowPass.getString(0)); tempBundle.putString("pass", cursorShowPass.getString(1)); tempBundle.putString("info", cursorShowPass.getString(2)); dialogShowPass.setArguments(tempBundle); dialogShowPass.show(getFragmentManager(), "editPass"); } else { Toast.makeText(MainActivity.this, "Data not send into Bundle"+" "+cursorShowPass.getCount(), Toast.LENGTH_SHORT).show(); } } });
_idmatches the position in the list? - Eugene Krivenja