curioustechizen / android-ago

An Android TextView that always displays an auto refreshing relative time span with respect to a reference time

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

View "lifecycle" not handled correctly w.r.t handler that refreshes display text.

curioustechizen opened this issue · comments

The method startTaskForPeriodicallyUpdatingRelativeTime() is called both in onAttachedToWindow() and in onVisibilityChanged(). This could result in the Runnable being scheduled twice.

This is because the first time the RelativeTimeTextView is added to its parent, both onAttachedToWindow() and onVisibilityChanged() are called (the latter is called for the parent Window).