I would like to find out the weather information with using yahoo api. However, I get error when the following statement was executed. May I have some hints to solve it? Thanks.
HttpClient httpClient = new DefaultHttpClient();
HttpGet httpGet = new HttpGet(queryString);
HttpEntity httpEntity = httpClient.execute(httpGet).getEntity(); // <--- error here
i had added the internet permission to mainfest.
03-01 22:06:27.310: E/AndroidRuntime(27723): FATAL EXCEPTION: main
03-01 22:06:27.310: E/AndroidRuntime(27723): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.exercise.AndroidYahooWeatherDOM/com.exercise.AndroidYahooWeatherDOM.AndroidYahooWeatherDOMActivity}: android.os.NetworkOnMainThreadException
03-01 22:06:27.310: E/AndroidRuntime(27723): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1967)
03-01 22:06:27.310: E/AndroidRuntime(27723): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1992)
03-01 22:06:27.310: E/AndroidRuntime(27723): at android.app.ActivityThread.access$600(ActivityThread.java:127)
03-01 22:06:27.310: E/AndroidRuntime(27723): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158)
03-01 22:06:27.310: E/AndroidRuntime(27723): at android.os.Handler.dispatchMessage(Handler.java:99)
03-01 22:06:27.310: E/AndroidRuntime(27723): at android.os.Looper.loop(Looper.java:137)