안드로이드 개발 질문/답변
(글 수 45,052)
url주소를 이용하여 이미지를 불러오려고 하는데요
소스는 이런식으로 하고 에뮬에서 돌릴땐 잘나오는데(안나올때도 있습니다만)
에뮬로 실행할때는 잘 되는데 폰에다가 하면 아에 이미지가 나오질 않습니다..
왜 그런건지 도저히 알 수가 없네요..T-T
에뮬에서 잘나올때도 있는데 안나올때도 있습니다..
해당 소스 올립니다..
URL imgUrl = new URL(이미지 주소); HttpURLConnection conn = (HttpURLConnection) imgUrl.openConnection(); conn.connect(); BufferedInputStream bis = new BufferedInputStream(conn.getInputStream()); Bitmap bmp = BitmapFactory.decodeStream(bis); bis.close(); ImageView iv = (ImageView) findViewById(R.id.img); iv.setImageBitmap(bmp);
소스는 이런식으로 하고 에뮬에서 돌릴땐 잘나오는데(안나올때도 있습니다만)
폰에서는 아에 나오질 않습니다.. 뭐가 잘 못된건지 알려주세요..T-T
그리고 bmp를 캔버스를 이용하여 이것저것 그리고서 출력하려고 했는데..
NULL포인트 에러가 나더라구여 bmp에서.. 이 현상을 어떻게 해야 해결할 수 있나요..T-T
방금 logcat을 봤는데요
에뮬과 폰의 logcat을 봤을 때 폰에서만 나오는 메시지가 있습니다.
내용은 다음과 같습니다.
D/skia ( 2556): --- decoder->decode returned false
V/InputManagerService( 146): unbindCurrentInputLocked: client = android.os.BinderProxy@337c9840
V/InputManagerService( 146): Hide switching menu
V/InputManagerService( 146): switching to client: client = android.os.BinderProxy@337fa538
V/InputManagerService( 146): Creating new session for client ClientState{335d1940 uid 10205 pid 2556}
V/InputManagerService( 146): Disabling: SessionState{uid 10084 pid 381 method 3347e4c0 session 3379f630}
V/InputManagerService( 146): Enabling: SessionState{uid 10205 pid 2556 method 3347e4c0 session 3375dba8}
V/InputManagerService( 146): windowGainedFocus: android.os.BinderProxy@337fa538
viewHasFocus=false isTextEditor=false softInputMode=#120 first=true flags=#10100
V/InputManagerService( 146): Unspecified window will hide input
I/ActivityManager( 146): Displayed activity com.yjlim.face/.FaceMain: 4521 ms (total 4521 ms)



