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

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved