0
Good evening, I am not able to solve the problem, it says it has an unregistered object (null Object Reference), but it does not have to initialize the following code:
public void deletar(int id)
{
conn.delete("RESULTADO", "_id = ?", new String[] { String.valueOf(id)});
}
He says this is it! The mistake: Attempt to invoke virtual method 'void project.henry.Count.domain.repoResult.deletar(int)' on a null Object Reference.
The code using that method:
Button btnApagar;
...
btnApagar = (Button) findViewById(R.id.btnApagar);
btnApagar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
try{
repoResultado.deletar(dados.getId());
} catch (Exception ex){
mensagem("ERRO: " + ex.getMessage());
}
}
});
It worked now, really it was not being instantiated. Thank you!
– Henrique