@@ -24,6 +24,7 @@ allprojects {
2424We have Two classes FetchData and PutData. Import the Library to your file first (In android studio paste the code and press alt + enter).
2525### Read Data From a URL - FetchData.class
2626```
27+ //Start ProgressBar first (Set visibility VISIBLE)
2728Handler handler = new Handler();
2829handler.post(new Runnable() {
2930 @Override
@@ -32,6 +33,7 @@ handler.post(new Runnable() {
3233 if (fetchData.startFetch()) {
3334 if (fetchData.onComplete()) {
3435 String result = fetchData.getResult();
36+ //End ProgressBar (Set visibility to GONE)
3537 Log.i("FetchData", result);
3638 }
3739 }
@@ -41,6 +43,7 @@ handler.post(new Runnable() {
4143
4244### Write data with POST and GET methods - PutData.class
4345```
46+ //Start ProgressBar first (Set visibility VISIBLE)
4447Handler handler = new Handler();
4548handler.post(new Runnable() {
4649 @Override
@@ -58,8 +61,7 @@ handler.post(new Runnable() {
5861 if (putData.startFetch()) {
5962 if (putData.onComplete()) {
6063 String result = putData.getResult();
61- progressBar.setVisibility(View.GONE);
62- textView.setText(result);
64+ //End ProgressBar (Set visibility to GONE)
6365 Log.i("PutData", result);
6466 }
6567 }
0 commit comments