Bug when pulling the drawable id straight from the database

0

I'm developing an application that among one of the functions is to list categories of food products, these categories are registered in sqlite, containing the id, category name and id of the image that is inside the drawable folder of android. >

The problem is that while buildo sometimes to test the application the images of my categories change completely random.

the insertion of the categories and done soon after creating the bank in the oncreate method as in the example below

//codigo do banco

values.put(Contrato.CategoriaEntry.CATEGORIA, "Doces");
    values.put(Contrato.CategoriaEntry.ICONE, R.drawable.c_sobremesa);
    db.insert(Contrato.CategoriaEntry.TABLE_NAME,null,values);

    values.put(Contrato.CategoriaEntry.CATEGORIA, "Petiscos");
    values.put(Contrato.CategoriaEntry.ICONE, R.drawable.c_petisco);
    db.insert(Contrato.CategoriaEntry.TABLE_NAME,null,values);
    
asked by anonymous 22.08.2018 / 01:57

0 answers