android.os.NetworkOnMainThreadException [duplicate]

It is because you are performing network operation on main thread of activity. Using Async task will be a better option.

Leave a Comment