Android UI Tutorial - Android AnalogClock








The analog clock in Android is a two-handed clock, with one hand for the hour indicator and the other hand for the minute indicator.

The control is just for displaying the current time.

Example

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical">

    <AnalogClock
        android:layout_width="wrap_content"
        android:layout_height="wrap_content" />

</LinearLayout>

Java code

package com.java2s.app;
//from  www . j a  v a2  s  . c  o  m
import android.app.Activity;
import android.os.Bundle;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

}
null