Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

After starting a service my activity hangs

 
Naishadh Parmar
Ranch Hand
Posts: 95
C++ Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
I have this service

when I start this service with the startService(Intent) method from my Activity. My Activity hangs. Why?
 
Tim Moores
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At a cursory glance, it seems that the run method of the tAlarm thread does busy waiting without ever stopping or sleeping.
 
Naishadh Parmar
Ranch Hand
Posts: 95
C++ Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So how do I solve it Tim
Is there an easier way to perform the same function.
I myself know that the thread keeps the phone pretty busy
 
Tim Moores
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One approach would be to let the thread sleep for 60 seconds after each invocation, since it doesn't do anything on a finer granularity than that.
 
Naishadh Parmar
Ranch Hand
Posts: 95
C++ Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh yeah,
Thanks Tim.
Just one question. Are you an SCJD or something???
Because you are too experienced. You have 2000+ posts and I have seen other threads, your posts are mostly useful and more 'to the point'
Thanks a lot Tim
See you soon
 
Tim Moores
Bartender
Posts: 2795
38
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the kind words; I never knew one could be "too experienced" :-) I don't have any certifications, as I never worked in a job market where any of those would have counted for much. I do have a degree in computer science, though, and that more than makes up for it :-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic