안드로이드 개발 질문/답변
(글 수 45,052)
SD카드에 있는 이미지를 ImageView에 표시하려고 하는데
이미지가 왜 안뜰까요..;;;
제가 잘못한 부분이 있나요??
에러는 나지 않습니다.
디버깅 해보니까.
Bitmap mPhotoBitmap 여기에 null 이 들어가요;
자바소스코드 (java)
ImageView mImgViewPhoto_01 = (ImageView)findViewById(R.id.image1);
BitmapFactory.Options options = new BitmapFactory.Options();
options.inSampleSize = 1;
Bitmap mPhotoBitmap = BitmapFactory.decodeFile("/sdcard/data/com.android.exam/image/3.jpg", options);
mImgViewPhoto_01.setImageBitmap(mPhotoBitmap);
xml 코드
<ImageView
android:id="@+id/image1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_gravity="center" />




경로명 맞나요? 보통 sdcard 경로명은 /mnt/sdcard/....이런 식으로 시작합니다.