OngoingActivityStatus
public
class
OngoingActivityStatus
extends Object
implements
VersionedParcelable
java.lang.Object
|
↳ |
androidx.wear.ongoingactivity.OngoingActivityStatus
|
Base class to serialize / deserialize OngoingActivityStatus
into / from a Notification
The classes here use timestamps for updating the displayed representation of the status, in
cases when this is needed (chronometers), as returned by
SystemClock.elapsedRealtime()
Summary
Public methods |
long
|
getNextChangeTimeMillis(long fromTimeMillis)
Returns the timestamp of the next time when the display will be different from the current
one.
|
CharSequence
|
getText(Context context, long timeNowMillis)
Returns a textual representation of the ongoing activity status at the given time
represented as milliseconds timestamp
For forward compatibility, the best way to display this is on a
TextView
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public methods
getNextChangeTimeMillis
public long getNextChangeTimeMillis (long fromTimeMillis)
Returns the timestamp of the next time when the display will be different from the current
one.
Parameters |
fromTimeMillis |
long : current time, usually now as returned by
SystemClock.elapsedRealtime() . In most cases
getText and getNextChangeTimeMillis should be called
with the exact same timestamp, so changes are not missed. |
Returns |
long |
the first point in time after fromTimeMillis when the displayed value of
this status will change. returns Long.MAX_VALUE if the display will never change.
|
getText
public CharSequence getText (Context context,
long timeNowMillis)
Returns a textual representation of the ongoing activity status at the given time
represented as milliseconds timestamp
For forward compatibility, the best way to display this is on a
TextView
Parameters |
context |
Context : may be used for internationalization. Only used while this method
executed. |
timeNowMillis |
long : the timestamp of the time we want to display, usually now, as
returned by SystemClock.elapsedRealtime() .
|