Android - how update widget often but only when it is visible?

Posted by tomash on Stack Overflow See other posts from Stack Overflow or by tomash
Published on 2010-03-10T12:24:24Z Indexed on 2010/05/30 1:22 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

I'm going to create widget which needs to update its content every minute (it shows time-related data).

However, there is no need to update widget if it is currently invisible, which means:

  • screen is turned off
  • another app is running
  • widget is placed on another (invisible) home screen tab

What is the best way to update only visible widget every minute - without waking up device nor doing unnecessary computations? After widget becomes visible, small lag before update is acceptable.

© Stack Overflow or respective owner

Related posts about android

Related posts about update