Menu

android.os.NetworkOnMainThreadException

Android By Jan 16, 2015 No Comments
android.os.NetworkOnMainThreadException  is an android runtime exception which occurs when you are trying to run any network or IO related operations from main activity. Android doesn’t support to run IO operations directly on the main activity.
So to avoid this exception, use a thread to do these operations or you can also use AsyncTask class which helps you to run the code in the background.

No Comments

Leave a comment

Hi, Welcome here.
JOIN OUR NEWSLETTER
And get notified everytime we publish a new blog post.