안드로이드 개발 질문/답변
(글 수 45,052)
안녕하세여
완전 초보입니다.
데이터베이스에 이미지 경로만 저장하고
그 경로로 다시 이미지뷰에 보여지는걸 하려고 하는데여
이미지는 프로젝트안에 drawable 폴더에 들어있습니다.
제가 궁금한건.. drawable 폴더 안에 있는 이미지 경로를 데이터베이스에 저장할때
경로가 정확히 어떻게 되는지 잘 모르겠구요
그걸 다시 이미지뷰로 불러 올때 어떤 메서드로 어떻게 불러오는지 잘 모르겠습니다.
자세히 알려주시면 감사하겠습니다^^ 새해 복 마니 받으세요
2013.01.06 12:03:11
public void setImageResource (int resId)
Added in API level 1
Sets a drawable as the content of this ImageView.
This does Bitmap reading and decoding on the UI thread, which can cause a latency hiccup. If that's a concern, consider usingsetImageDrawable(android.graphics.drawable.Drawable) or setImageBitmap(android.graphics.Bitmap) andBitmapFactory instead.
Related XML Attributes
Parameters
| resId | the resource identifier of the the drawable |
|---|




drawable라면 굳이 file path를 저장하지 않으셔도될거같습니다... R.drawable.이미지값을
박아넣고 그걸 뽑아와서 이미지뷰에 적용시켜도 되니까여