Access a image dynamically from res folder android -
i have image in res folder this
i want access 1 dynamically this
holder.viewcover.setimagedrawable(drawable.createfrompath("r.id." + coverimgurl.get(position)));
coverimgurl list have 2 image name 1 book_cover & , blank_image array generated dynamically how can set image list
in 1 word how access image dynamically in drawable folder , need image name array list ?
resources res = getresources(); string mdrawablename = "image_name"; int resourceid = res.getidentifier(mdrawablename , "drawable", getpackagename()); drawable drawable = res.getdrawable(resourceid); icon.setimagedrawable(drawable );
Comments
Post a Comment