It is because you are performing network operation on main thread of activity. Using Async task will be a better option.
More Related Contents:
- Java, Simple XML parsing list
- Been staring at my code for an hour and still can't see the issue. Android – Java development [closed]
- Activity keeps crashing
- How to work with xml and java (android) [closed]
- How to parse invalid (bad / not well-formed) XML?
- How to read and write XML files?
- How to parse XML using the SAX parser
- NoClassDefFoundError in Eclipse
- How to add image in a TextView text?
- How to get the selected index of a RadioGroup in Android
- Android Resource – Array of Arrays
- Use custom Manifest file and permission in Unity?
- Error inflating when extending a class
- ImageView rounded corners [duplicate]
- How to fix Invalid byte 1 of 1-byte UTF-8 sequence
- Is there an easier way to parse XML in Java?
- Java parsing XML document gives “Content not allowed in prolog.” error [duplicate]
- Rotate Marker and Move Animation on Map like Uber Android
- Custom Progress Bar in Android? [closed]
- No resource identifier found for attribute ‘layout_behavior’ in package
- Android : java.lang.OutOfMemoryError:
- How to activate “Share” button in android app?
- Android View Clipping
- Android: How to push button above soft keyboard
- How do I get a button to open another activity?
- Android Failed to instantiate one or more classes
- How to ZXING Barcode Scanner not full screen only half screen
- Hiding ‘Bottom Navigation Bar’ whilst keyboard is present – Android
- Where I can find a detailed comparison of Java XML frameworks? [closed]
- Parsing XML file containing HTML entities in Java without changing the XML