How to stop progressbar spinning after connection has been lost in AndroidHow do save an Android Activity state using save instance state?Why is the Android emulator so slow? How can we speed up the Android emulator?How to change progress bar's progress color in AndroidHow do I pass data between Activities in Android application?How do I display an alert dialog on Android?How can I connect to Android with ADB over TCP?How to call a method after a delay in AndroidHow do I rotate the Android emulator display?How to manage startActivityForResult on Android?How to make a spinning refresh icon in android

What exact color does ozone gas have?

Is aluminum electrical wire used on aircraft?

Limits and Infinite Integration by Parts

What should you do when eye contact makes your subordinate uncomfortable?

What happens if you are holding an Iron Flask with a demon inside and walk into an Antimagic Field?

What is the evidence for the "tyranny of the majority problem" in a direct democracy context?

Calculating total slots

Can disgust be a key component of horror?

How much character growth crosses the line into breaking the character

Pre-mixing cryogenic fuels and using only one fuel tank

A social experiment. What is the worst that can happen?

Mixing PEX brands

15% tax on $7.5k earnings. Is that right?

Strong empirical falsification of quantum mechanics based on vacuum energy density

Is this toilet slogan correct usage of the English language?

Why is so much work done on numerical verification of the Riemann Hypothesis?

Biological Blimps: Propulsion

Can a College of Swords bard use a Blade Flourish option on an opportunity attack provoked by their own Dissonant Whispers spell?

What are some good ways to treat frozen vegetables such that they behave like fresh vegetables when stir frying them?

What does chmod -u do?

Lowest total scrabble score

Is there an injective, monotonically increasing, strictly concave function from the reals, to the reals?

What is going on with 'gets(stdin)' on the site coderbyte?

Redundant comparison & "if" before assignment



How to stop progressbar spinning after connection has been lost in Android


How do save an Android Activity state using save instance state?Why is the Android emulator so slow? How can we speed up the Android emulator?How to change progress bar's progress color in AndroidHow do I pass data between Activities in Android application?How do I display an alert dialog on Android?How can I connect to Android with ADB over TCP?How to call a method after a delay in AndroidHow do I rotate the Android emulator display?How to manage startActivityForResult on Android?How to make a spinning refresh icon in android













1















When I pressed back button on the mobile phone after that I switch off the wifi or mobile data network.



Progress bar spinning does not get stop and back button does not work.



 protected void onRefreshingStateChanged(boolean refreshing) 
super.onRefreshingStateChanged(refreshing);

if (!refreshing)
if (mProgressDialog != null && isBackPressed)
mProgressDialog.hide();
mProgressDialog = null;
this.setResult(RESULT_OK, getIntent());
finish();


else
if (mProgressDialog == null && isBackPressed)
mProgressDialog = ProgressDialog.show(this, "Fetching Data",
"Please wait while we are updating records ...", true);












share|improve this question
























  • try mProgressDialog .dismiss();

    – saeed
    Apr 19 '16 at 4:18











  • Don't use .hide, use .dismiss as @saeed said. Especially when then finish is executed.

    – CoolMind
    Oct 12 '16 at 10:06















1















When I pressed back button on the mobile phone after that I switch off the wifi or mobile data network.



Progress bar spinning does not get stop and back button does not work.



 protected void onRefreshingStateChanged(boolean refreshing) 
super.onRefreshingStateChanged(refreshing);

if (!refreshing)
if (mProgressDialog != null && isBackPressed)
mProgressDialog.hide();
mProgressDialog = null;
this.setResult(RESULT_OK, getIntent());
finish();


else
if (mProgressDialog == null && isBackPressed)
mProgressDialog = ProgressDialog.show(this, "Fetching Data",
"Please wait while we are updating records ...", true);












share|improve this question
























  • try mProgressDialog .dismiss();

    – saeed
    Apr 19 '16 at 4:18











  • Don't use .hide, use .dismiss as @saeed said. Especially when then finish is executed.

    – CoolMind
    Oct 12 '16 at 10:06













1












1








1








When I pressed back button on the mobile phone after that I switch off the wifi or mobile data network.



Progress bar spinning does not get stop and back button does not work.



 protected void onRefreshingStateChanged(boolean refreshing) 
super.onRefreshingStateChanged(refreshing);

if (!refreshing)
if (mProgressDialog != null && isBackPressed)
mProgressDialog.hide();
mProgressDialog = null;
this.setResult(RESULT_OK, getIntent());
finish();


else
if (mProgressDialog == null && isBackPressed)
mProgressDialog = ProgressDialog.show(this, "Fetching Data",
"Please wait while we are updating records ...", true);












share|improve this question
















When I pressed back button on the mobile phone after that I switch off the wifi or mobile data network.



Progress bar spinning does not get stop and back button does not work.



 protected void onRefreshingStateChanged(boolean refreshing) 
super.onRefreshingStateChanged(refreshing);

if (!refreshing)
if (mProgressDialog != null && isBackPressed)
mProgressDialog.hide();
mProgressDialog = null;
this.setResult(RESULT_OK, getIntent());
finish();


else
if (mProgressDialog == null && isBackPressed)
mProgressDialog = ProgressDialog.show(this, "Fetching Data",
"Please wait while we are updating records ...", true);









java android android-progressbar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 6:34









Cœur

19k9114155




19k9114155










asked Apr 19 '16 at 3:56









Banti KumarBanti Kumar

259




259












  • try mProgressDialog .dismiss();

    – saeed
    Apr 19 '16 at 4:18











  • Don't use .hide, use .dismiss as @saeed said. Especially when then finish is executed.

    – CoolMind
    Oct 12 '16 at 10:06

















  • try mProgressDialog .dismiss();

    – saeed
    Apr 19 '16 at 4:18











  • Don't use .hide, use .dismiss as @saeed said. Especially when then finish is executed.

    – CoolMind
    Oct 12 '16 at 10:06
















try mProgressDialog .dismiss();

– saeed
Apr 19 '16 at 4:18





try mProgressDialog .dismiss();

– saeed
Apr 19 '16 at 4:18













Don't use .hide, use .dismiss as @saeed said. Especially when then finish is executed.

– CoolMind
Oct 12 '16 at 10:06





Don't use .hide, use .dismiss as @saeed said. Especially when then finish is executed.

– CoolMind
Oct 12 '16 at 10:06












1 Answer
1






active

oldest

votes


















1














try to set cancelable property of progressbar.



mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(true);





share|improve this answer


















  • 1





    @BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

    – Sufian
    Oct 6 '16 at 11:32











  • Thanks for help

    – Banti Kumar
    Feb 7 '17 at 5:53






  • 1





    @BantiKumar anytime :)

    – Hello World
    Feb 7 '17 at 10:08










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36708271%2fhow-to-stop-progressbar-spinning-after-connection-has-been-lost-in-android%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














try to set cancelable property of progressbar.



mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(true);





share|improve this answer


















  • 1





    @BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

    – Sufian
    Oct 6 '16 at 11:32











  • Thanks for help

    – Banti Kumar
    Feb 7 '17 at 5:53






  • 1





    @BantiKumar anytime :)

    – Hello World
    Feb 7 '17 at 10:08















1














try to set cancelable property of progressbar.



mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(true);





share|improve this answer


















  • 1





    @BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

    – Sufian
    Oct 6 '16 at 11:32











  • Thanks for help

    – Banti Kumar
    Feb 7 '17 at 5:53






  • 1





    @BantiKumar anytime :)

    – Hello World
    Feb 7 '17 at 10:08













1












1








1







try to set cancelable property of progressbar.



mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(true);





share|improve this answer













try to set cancelable property of progressbar.



mProgressDialog = new ProgressDialog(this);
mProgressDialog.setCancelable(true);






share|improve this answer












share|improve this answer



share|improve this answer










answered Apr 19 '16 at 4:28









Hello WorldHello World

2,4181718




2,4181718







  • 1





    @BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

    – Sufian
    Oct 6 '16 at 11:32











  • Thanks for help

    – Banti Kumar
    Feb 7 '17 at 5:53






  • 1





    @BantiKumar anytime :)

    – Hello World
    Feb 7 '17 at 10:08












  • 1





    @BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

    – Sufian
    Oct 6 '16 at 11:32











  • Thanks for help

    – Banti Kumar
    Feb 7 '17 at 5:53






  • 1





    @BantiKumar anytime :)

    – Hello World
    Feb 7 '17 at 10:08







1




1





@BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

– Sufian
Oct 6 '16 at 11:32





@BantiKumar if this or any answer has solved your question please consider accepting it by clicking the check-mark. This indicates to the wider community that you've found a solution and gives some reputation to both the answerer and yourself. There is no obligation to do this.

– Sufian
Oct 6 '16 at 11:32













Thanks for help

– Banti Kumar
Feb 7 '17 at 5:53





Thanks for help

– Banti Kumar
Feb 7 '17 at 5:53




1




1





@BantiKumar anytime :)

– Hello World
Feb 7 '17 at 10:08





@BantiKumar anytime :)

– Hello World
Feb 7 '17 at 10:08



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36708271%2fhow-to-stop-progressbar-spinning-after-connection-has-been-lost-in-android%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

1928 у кіно

Захаров Федір Захарович

Ель Греко