안드로이드 개발 질문/답변
(글 수 45,052)
import java.util.*;
import android.app.*; import android.graphics.*; import android.graphics.drawable.*; import android.os.*; import android.util.Log; import android.view.*; import android.widget.*;
public class Man extends Activity {
ImageButton image01, image02;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.selecttype);
// TODO Auto-generated method stub
image01 = (ImageButton)findViewById(R.id.Select01);
image02 = (ImageButton)findViewById(R.id.Select02);
String imageurl = "http://sstatic.naver.net/people/28/20071005181335197040222.jpg";
try {
InputStream is = new URL(imageurl).openStream();
Bitmap bit = BitmapFactory.decodeStream(is);
image01.setImageBitmap(bit);
is.close();
} catch (Exception e)
{
e.printStackTrace();
}
}책에 있는거 보구 똑같이 쳤거든요 -_-; 책에 있는 예제를 다운받아서 실행하니깐너무 너무 잘되는데 -_-; 제가 친거는 머가 문제 일까요? 설명을 드리자면
String imageurl = "http://sstatic.naver.net/people/28/20071005181335197040222.jpg";
요골로 인터넷상의 이미지 주소를 받아 옵니다
InputStream is = new URL(imageurl).openStream();
여기서 InputStream 에 저장한뒤에 디코드 하여 비트맵에 뿌려주는건데요 계속 Exception 나는 이유가 몰까요 ㅠㅠㅠ
아놔 책보고 똑같이 쳤는데 왜 이렇게 저한테 시련을 주시는지 기말고사 문제라서 이게... 빠른 답변좀 부탁 드려요 3시 반이라서
뜬눈으로 학교갑니다 ㅠㅠㅠㅠㅠㅠㅠ



