I have a .png file in my assets folder and I'm trying to get that image to show on screen when I tap the screen.
InputStream open = null;
try{
open = asset.open("ic_launcher.png");
Bitmap bitmap = BitmapFactory.decodeStream(open);
ImageView image = (ImageView)findViewById(R.id.imageView1);
image.setImageBitmap(bitmap);
}catch(Exception e){
e.printStackTrace();
}
finally{
if(open != null){
try{
open.close();
}catch(IOException e){
e.printStackTrace();
}
}
}
But I keep getting the FileNotFoundException
and don't know why.