Win a copy of Head First Android this week in the Android forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
  • Al Hobbs
  • salvin francis

Retain chronograph counting during screen rotation

Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

I have a simple app that starts a counter when start button is pressed. I would like the counter to keep counting even during screen rotations. For that i've put the Chronometer in a fragment and used setretaininstance. The idea is to store the time counted in parameter elapsedMillis, and use this to update the chronometer when isCounting = true. Put in simple words, i want a timer that keeps counting even during screen rotation. This, however doesn't work at all - after screen rotation i can't even start it. What is wrong?





Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic