0
nome = (EditText) findViewById(R.id.edt_nomecli);
listaclientes.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
Integer cod = i;
Cursor cursor = banco.rawQuery("SELECT nome FROM clientes WHERE id_cli = '"+cod+"' ",null);
if(cursor!=null)
{
int cnome=cursor.getColumnIndex("nome");
nome.setText(cursor.getString(cnome), TextView.BufferType.EDITABLE);
}
}
});
THE ERROR IS AT EXECUTION TIME.
Are you adding
final
before and declare a variablenome
? Ex:final String nome = (EditText) findViewById(R.id.edt_nomecli);
– Valdeir Psr
What’s the mistake ?
– ramaral
I suggest you search the bank when you start
activity
and save in aArrayList
, the way he is doing he searches that list from the bank whenever the user clicks onListView
having a performance reduction– Costamilam