• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Variables afer thread are not being display in the activity?

 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I am trying to display magX, mahY, magZ and teslaXYZ variables after the Thread in the acitivity but nothing is being display when I comment the Thread.sleep(10 * 1000); as well try catch block all values are being displayed in the actvity.
I have added the thread to delay the sensor reading, is my appraoch the right way to do that?
Can someone explain me how can I display the variable after the thread in the activity?



I apreciate any help.


 
Rancher
Posts: 989
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't call Thread.sleep on the event display thread. You should implement the onPostExecute method in your AsyncTask and use that to update the user interface.

Also read through the tutorial http://www.vogella.com/tutorials/AndroidBackgroundProcessing/article.html" target="_blank" rel="nofollow">here which also has an example of how to use AsyncTasks.
reply
    Bookmark Topic Watch Topic
  • New Topic