Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SubjectTask extends AsyncTask<Void, Void, Integer> {
- @Override
- protected void onPreExecute() {
- progressDialog = ProgressDialog.show(Login.this, "Loading",
- "Please wait...");
- //checkConnection();
- }
- @Override
- protected Integer doInBackground(Void... arg0) {
- if (isOnline()) { //using ConnectivityManager And Network Info
- try {
- //Http Request connections
- } catch (Exception e) {
- e.printStackTrace();
- }
- return 1;
- } else {
- alert("Check your internet connection");
- return 0;
- }
- }
- protected void onPostExecute(Integer result) {
- super.onPostExecute(result);
- if (progressDialog.isShowing()) {
- progressDialog.dismiss();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement