2012-12-10 7 views

답변

0

시도 :

File imgFile = new File(“/sdcard/Images/test_image.jpg”); 
if(imgFile.exists()){ 

    Bitmap myBitmap = BitmapFactory.decodeFile(imgFile.getAbsolutePath()); 
    Drawable drawable = new BitmapDrawable(getResources(), bitmap); 
    layout.setBackground(drawable); 
} 

참고로, 당신이 할 수있는 대신 SD 카드

+0

내 URI는이 정적 경로의 getExternalStorageDirectory() : 파일 : ///mnt/sdcard/shopfloor/backgroundimg0.png. –

+0

내 URI는 : file : ///mnt/sdcard/shopfloor/backgroundimg0.png입니다. imageFile이 그런 URI에서 생성 된 것 같지 않습니다. –

관련 문제