HttpURLConnection выдает исключение [дубликат]Android

Форум для тех, кто программирует под Android
Anonymous
HttpURLConnection выдает исключение [дубликат]

Сообщение Anonymous »


Here is my code to connect HTTP.

URL url = new URL("http://www.google.com"); HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setDoOutput(true); String responseMsg = con.getResponseMessage(); int response = con.getResponseCode(); this is throwing android.os.NetworkOnMainThreadException

Please help.


Источник: https://stackoverflow.com/questions/154 ... -exception

Вернуться в «Android»