Sqlite bank closed when query

Asked

Viewed 29 times

0

Good afternoon, I’m making an android application, I’m having some problems with the bank. When it runs on the emulator it calls the seller’s Activity after saved, it calls login, login has a getConfiguration() method, it is in the configuration method that the error occurs when opening the database, all methods of the DAO classes have the same structure as the Seller’s. Someone what I’m doing wrong!!

public void salvarVendedor(Vendedor vendedor){
    bancoDados.escrever().beginTransaction();
    try {
        values = new ContentValues();
        values.put("id_vendedor",vendedor.getIdVendedor());
        values.put("login",vendedor.getLogin());
        values.put("senha",vendedor.getSenha());
        values.put("desconto",vendedor.getDesconto());
        values.put("mac",vendedor.getMac());
        values.put("inativo", vendedor.getInativo());
        values.put("valor_verba", vendedor.getValorVerba());

        bancoDados.escrever().insert("TB_VENDEDORES",null,values);
        bancoDados.escrever().setTransactionSuccessful();
    } catch (SQLiteException e){
        Log.i("Erro ","salvar vendedor" + e.getMessage());
    } finally {
        bancoDados.escrever().endTransaction();
        bancoDados.close();
    }
}
  • Beauty? What error are you getting?

  • gives the address of the bank in the Data folder and says that this closed Database is closed

  • I understand, in what method do you open the connection to the bank?

  • in the login has the getConfiguration() to check a few things before logging in, there is the error.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.