By using AsyncTask (recommended)
Disable Strict Mode (Not recommended)
if (android.os.Build.VERSION.SDK_INT > 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); }Want to save this article for later? Click the heart in the bottom right corner to save to your own articles box!
Sandeep Bhandari holds a Bachelor of Engineering in Computers from Thapar University (2006). He has 20 years of experience in the technology field. He has a keen interest in various technical fields, including database systems, computer networks, and programming. You can read more about him on his bio page.
What do you think?
6
4
11
9
16
9