Does resource id changes everytime an application starts

前端 未结 3 981
后悔当初
后悔当初 2020-12-17 23:06

I am storing my images in drawable and their resource id in SQLite database.My database is created when the application starts for the first time.

Is it good to save

3条回答
  •  渐次进展
    2020-12-17 23:55

    the best way was to store image name directly into database and fetch it,then use

    int resID = this.getResources().getIdentifier("your photo name fetched from database","drawable","package name");
    
    image.setResourceID(resID);
    

提交回复
热议问题