Loading docs/html/training/basics/network-ops/connecting.jd +2 −2 Original line number Original line Diff line number Diff line Loading @@ -136,7 +136,7 @@ public class HttpExampleActivity extends Activity { getSystemService(Context.CONNECTIVITY_SERVICE); getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { if (networkInfo != null && networkInfo.isConnected()) { new DownloadWebpageText().execute(stringUrl); new DownloadWebpageTask().execute(stringUrl); } else { } else { textView.setText("No network connection available."); textView.setText("No network connection available."); } } Loading @@ -147,7 +147,7 @@ public class HttpExampleActivity extends Activity { // has been established, the AsyncTask downloads the contents of the webpage as // has been established, the AsyncTask downloads the contents of the webpage as // an InputStream. Finally, the InputStream is converted into a string, which is // an InputStream. Finally, the InputStream is converted into a string, which is // displayed in the UI by the AsyncTask's onPostExecute method. // displayed in the UI by the AsyncTask's onPostExecute method. private class DownloadWebpageText extends AsyncTask<String, Void, String> { private class DownloadWebpageTask extends AsyncTask<String, Void, String> { @Override @Override protected String doInBackground(String... urls) { protected String doInBackground(String... urls) { Loading Loading
docs/html/training/basics/network-ops/connecting.jd +2 −2 Original line number Original line Diff line number Diff line Loading @@ -136,7 +136,7 @@ public class HttpExampleActivity extends Activity { getSystemService(Context.CONNECTIVITY_SERVICE); getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); NetworkInfo networkInfo = connMgr.getActiveNetworkInfo(); if (networkInfo != null && networkInfo.isConnected()) { if (networkInfo != null && networkInfo.isConnected()) { new DownloadWebpageText().execute(stringUrl); new DownloadWebpageTask().execute(stringUrl); } else { } else { textView.setText("No network connection available."); textView.setText("No network connection available."); } } Loading @@ -147,7 +147,7 @@ public class HttpExampleActivity extends Activity { // has been established, the AsyncTask downloads the contents of the webpage as // has been established, the AsyncTask downloads the contents of the webpage as // an InputStream. Finally, the InputStream is converted into a string, which is // an InputStream. Finally, the InputStream is converted into a string, which is // displayed in the UI by the AsyncTask's onPostExecute method. // displayed in the UI by the AsyncTask's onPostExecute method. private class DownloadWebpageText extends AsyncTask<String, Void, String> { private class DownloadWebpageTask extends AsyncTask<String, Void, String> { @Override @Override protected String doInBackground(String... urls) { protected String doInBackground(String... urls) { Loading