|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectandroid.view.View
android.widget.TextView
android.widget.Chronometer
public class Chronometer
Class that implements a simple timer.
You can give it a start time in the SystemClock.elapsedRealtime() timebase,
and it counts up from that, or if you don't give it a base time, it will use the
time at which you call start(). By default it will display the current
timer value in the form "MM:SS" or "H:MM:SS", or you can use setFormat(java.lang.String)
to format the timer value into an arbitrary string.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class android.widget.TextView |
|---|
TextView.BufferType, TextView.SavedState |
| Nested classes/interfaces inherited from class android.view.View |
|---|
View.BaseSavedState, View.MeasureSpec, View.OnClickListener, View.OnCreateContextMenuListener, View.OnFocusChangeListener, View.OnKeyListener, View.OnLongClickListener, View.OnTouchListener |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
Chronometer(Context context)
Initialize this Chronometer object. |
|
Chronometer(Context context,
AttributeSet attrs)
Initialize with standard view layout information. |
|
Chronometer(Context context,
AttributeSet attrs,
int defStyle)
Initialize with standard view layout information and style. |
|
| Method Summary | |
|---|---|
long |
getBase()
Return the base time as set through setBase(long). |
String |
getFormat()
Returns the current format string as set through setFormat(java.lang.String). |
protected void |
onDetachedFromWindow()
This is called when the view is detached from a window. |
protected void |
onWindowVisibilityChanged(int visibility)
Called when the window containing has change its visibility (between View.GONE, View.INVISIBLE, and View.VISIBLE). |
void |
setBase(long base)
Set the time that the count-up timer is in reference to. |
void |
setFormat(String format)
Sets the format string used for display. |
void |
start()
Start counting up. |
void |
stop()
Stop counting up. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Chronometer(Context context)
public Chronometer(Context context,
AttributeSet attrs)
public Chronometer(Context context,
AttributeSet attrs,
int defStyle)
| Method Detail |
|---|
public void setBase(long base)
base - Use the SystemClock.elapsedRealtime() time base.public long getBase()
setBase(long).
public void setFormat(String format)
format - the format string.public String getFormat()
setFormat(java.lang.String).
public void start()
setBase(long), just
the view display.
Chronometer works by regularly scheduling messages to the handler, even when the
Widget is not visible. To make sure resource leaks do not occur, the user should
make sure that each start() call has a reciprocal call to stop().
public void stop()
setBase(long), just
the view display.
This stops the messages to the handler, effectively releasing resources that would
be held as the chronometer is running, via start().
protected void onDetachedFromWindow()
View
onDetachedFromWindow in class TextViewView.onAttachedToWindow()protected void onWindowVisibilityChanged(int visibility)
ViewView.GONE, View.INVISIBLE, and View.VISIBLE). Note
that this tells you whether or not your window is being made visible
to the window manager; this does not tell you whether or not
your window is obscured by other windows on the screen, even if it
is itself visible.
onWindowVisibilityChanged in class Viewvisibility - The new visibility of the window.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||