Это исключение означает, что вы пытаетесь выполнить операцию, связанную с сетью, в основном потоке пользовательского интерфейса. Вам нужно сделать либо в отдельном потоке, либо в AsyncTask.
The exception that is thrown when an application attempts to perform a
networking operation on its main thread. This is only thrown for applications
targeting the Honeycomb SDK or higher. Applications targeting earlier SDK
versions are allowed to do networking on their main event loop threads, but it
heavily discouraged
class RetreiveFeedTask extends AsyncTask<String, Void, Void> {
protected Void doInBackground(String... urls) {
//Execurte the network related option here
}
protected void onPostExecute(Void param) {
// TODO: do something with the feed
}
}