Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>Its because you're doing network operation on</strong> <code>Main UI thread</code></p> <p>if you're using threads to do network operations then you can use this code snippet</p> <pre><code>if (android.os.Build.VERSION.SDK_INT &gt; 9) { StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build(); StrictMode.setThreadPolicy(policy); } </code></pre> <p>in your <code>OnCreate()</code></p> <p>But its wrong practice to use above said operation, instead you should use <code>AsyncTask</code> class provided by android to handle properly network operation <code>without blocking UI thread</code>.</p> <p>you can learn more by visiting this <a href="http://developer.android.com/reference/android/os/AsyncTask.html#usage" rel="nofollow">LINK</a></p> <p>or can use the below code</p> <pre><code>private class UploadFiles extends AsyncTask&lt;String, Void, Void&gt; { protected String doInBackground(String... urls) { //THIS METHOD WILL BE CALLED AFTER ONPREEXECUTE //YOUR NETWORK OPERATION HERE return null; } protected void onPreExecute() { super.onPreExecute(); //THIS METHOD WILL BE CALLED FIRST //DO OPERATION LIKE SHOWING PROGRESS DIALOG PRIOR TO BEGIN NETWORK OPERATION } protected void onPostExecute(String result) { super.onPostExecute(); //TNIS METHOD WILL BE CALLED AT LAST AFTER DOINBACKGROUND //DO OPERATION LIKE UPDATING UI HERE } } </code></pre> <p>and you can simple call this class by writing </p> <pre><code> new UploadFiles ().execute(new String[]{//YOUR LINK}); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload