2
I have an application where when the user logs in the first time, I save the Token
and NIU
, then the next time he accesses the application, he already enters directly into the Webview
using that token e NIU
that are in the database. However I need to delete this data when the user click on the "Quit" button on webview
. I already have a treatment for this button (exit), I can enter the treatment of erasing the database data here too, how to do?
METHOD BT_SAIR:
private void SairWV(){
Intent intent = new Intent(Webview.this, MainActivity.class);
startActivity(intent);
finish();
METHOD TO INSERT INTO THE BANK:
public long insere (Token token){
dao = new BancoDeDados(context);
SQLiteDatabase db = dao.getWritableDatabase();
dao.onCreate(db);
ContentValues dados = pegaDadosDoAcesso(token);
long inserir = db.insert(NOMETABELA, null, dados);
db.close();
Log.i(NOMETABELA, inserir + "");
return inserir;
}