I read from XML.
<movie>
<id>1</id>
<title>Fast</title>
<background>assets://icon/photography1</background>
</movie>
Now I have gotten Class Movie
.
How can I add assets://icon/photography1
in my ImageView?
I read from XML.
<movie>
<id>1</id>
<title>Fast</title>
<background>assets://icon/photography1</background>
</movie>
Now I have gotten Class Movie
.
How can I add assets://icon/photography1
in my ImageView?
You can add an image from assests to an image view programmatically through java code in android. Code for that is given below:
ImageView image = (ImageView) findViewById(R.id.imageView1);
AssetManager assetManager = getAssets();
InputStream istr;
try {
istr = assetManager.open("vishal.jpg");
Bitmap bitmap = BitmapFactory.decodeStream(istr);
image.setImageBitmap(bitmap);
istr.close();
} catch (IOException e) {
e.printStackTrace();
}