IDを使わずにimageviewに画像を表示したい。
すべての画像を raw フォルダーに配置して開きます
try {
String ss = "res/raw/images/inrax/3150-MCM.jpg";
in = new FileInputStream(ss);
buf = new BufferedInputStream(in);
Bitmap bMap = BitmapFactory.decodeStream(buf);
image.setImageBitmap(bMap);
if (in != null) {
in.close();
}
if (buf != null) {
buf.close();
}
} catch (Exception e) {
Log.e("Error reading file", e.toString());
}
しかし、これは機能していません名前ではなくパスを使用して画像にアクセスしたい