android.os.NetworkOnMainThreadException at android.os.StrictMode$AndroidBlockGuardPolicy.onNetwork(StrictMode.java:1145)

This exception is thrown when application attempts to perform a networking operation in the main thread. Use below code in your onViewCreated to avoid this error else Call your networking operations (getting data from web server) request in thread or Asynch class. public void onViewCreated(View view, Bundle savedInstanceState) { int SDK_INT = android.os.Build.VERSION.SDK_INT; if (SDK_INT … Read more