开发者

android drawable identifier in a database

what is the best way to store a drawable identifier in a database? by is id? but i开发者_StackOverflowf it is generated it can change, what to do? I've been looking arround but can't find complete information about it.


Why would you want to store drawable in database , you can simply create a Integer[] array containing all the ids from R.java class

like

Integer[] myDrawables = new Integer[]{
R.drawable.xdrawable,
R.drawable.ydrawable,
R.drawable.zdrawable,
}

now to access them becomes much easier. I usually define them in public static scope to make them accessible from anywhere

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜