• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

CalledFromWrongThreadException in progressbar  RSS feed

 
Ranch Hand
Posts: 1292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a progress bar in my app.i am getting below exception when i disable to internet connection while downloading the files.





This is the part of code which contain the pregressbar.


the line 368 which contain errors is "progressBar.setVisibility(View.INVISIBLE);".
 
Ranch Hand
Posts: 633
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



 
sam liya
Ranch Hand
Posts: 1292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I changed the code as below.but same exception


 
Ranch Hand
Posts: 202
Android Java PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try to make progressbar final.
 
Ranch Hand
Posts: 69
2
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The exception is pretty straight forward. Post a runnable to the UI thread that you created the progress bar on to update it.



If it seems verbose, clunky, ugly, and bug prone that's because it is. Lambdas should help to reduce the finger exercises when the dalvik bytecode specification is capable of supporting all Java 8 features.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!