Good night, I can not solve the problem, it says that it has an object not referenced (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 it's here! The error: Attempt to invoke virtual method 'void project.henry.count.domain.repoResult.deletar (int)' on a null object reference .
The code that uses this 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());
}
}
});