Android TextClock Example

activity_main.xml
 <RelativeLayout     xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/rl"     android:layout_width="match_parent"     android:layout_height="match_parent"     android:padding="10dp"     tools:context=".MainActivity"     android:background="#e8e4da"     >     <TextView         android:id="@+id/tv"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:text="This is a Text Clock."         android:textStyle="italic"         />     <!--         TextClock can display the current date         and/or time as a formatted string.     -->     <TextClock         android:id="@+id/tc"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@id/tv"         /> </RelativeLayout> 
More android examples

Komentar