データベースに入力するテキストを使用して機能する TextView を持っていますが、ローカル データベースに画像パス名を接続したいと考えています。これをどのようにJavaに組み込むことができますか?
私が設定している主な活動では:
String image = currentQ.getImage();
ImageView iView = (ImageView) findViewById(R.id.IS);
Bitmap bMap = BitmapFactory.decodeFile(image);
iView.setImageBitmap(bMap);
質問では:
private String image;
/**
* @return the image
*/
public String getImage() {
return image;
}
/**
* @param image the image to set
*/
public void setImage(String image) {
this.image = image;
}
データベースでは、それをテキストとして宣言しています。
file.path.name/drawable/i1.jpg and so on for the others.
データベース内の質問ごとにドローアブル フォルダに画像ファイルの場所を添付し、それを Java に接続するにはどうすればよいですか?
前もって感謝します。