안드로이드 개발 질문/답변
(글 수 45,052)
public void getXml(){
String urlAddr = "http://www.google.com/";
try{
HttpGet get = new HttpGet(URLEncoder.encode(urlAddr,"utf-8"));
DefaultHttpClient client = new DefaultHttpClient();
String html = "";
HttpResponse res = client.execute(get);
}catch (Exception e) {
// TODO: handle exception
Log.i("ERROR",e.getMessage());
}
간단하게 구글사이트에 요청해서 결과받아보는 그런거 만들었는데요..
자꾸 이런에러가 나네요
target host must not be null or set in parameters. scheme=null host=null
구글에서 검색해봐도 URL에 http://가 빠져서 그런걸꺼니까 http://를 붙이면해결될거라고하는데
저는 안빠트리고 잘 썼거든요 ㅠㅠ...이거 왜이러는걸까요




에러메세지에 Set in Parameters 나온거보니
client 파라미터 설정이 안되서 그런것같네요