how to get the path of the image(.png) file that is stored in assets folder in android -
i have few images in assets folder want retrieve path of each image file , copy them array , set image view condition. have used below code.but did not workout me. may know going wrong.
final uri assets_uri = uri.parse("file:///android_asset"); final string[] image_ids =new string[] {assets_uri+"/"+"one.png",assets_uri+"/"+"two.png",assets_uri+"/"+"three.png"}; iv=(imageview)findviewbyid(r.id.iv); if(i>=0 & i< image_ids.length-1) i=i+1; else if(i==image_ids.length-1) i=0; iv.setimageuri(uri.parse(image_ids[i]));
try change :
final uri assets_uri = uri.parse("file:///android_asset");
to this:
final string assets_uri = "file:///android_asset";
i think problem concatenating , uri string. if declare assets_uri string string , later parsed uri.
Comments
Post a Comment