如何在Android应用中更改图标。位于自定义位置。 例如:我在 drawable 中创建了新包,即 drawable / pre_paid_ico ,但是我无法以编程方式访问此位置的任何图标。这是我的代码
iconView = (ImageView) findViewById(R.id.icon);
int imageId = getResources().getIdentifier(array_ico[0], //icon name from array e.g[bg_icon]
"drawable/pre_paid_ico",//location of icons
"package.name.here"); //package Name
iconView.setImageResource(imageId);