2
我必須創建一個android世界時鐘部件。它應該將選定國家的時間顯示爲模擬時鐘小部件。需要幫助爲Android創建模擬世界時鐘部件
但我不知道如何更新窗口小部件視圖中的時間。
我嘗試使用小部件配置活動。但它並不成功。請給我一些想法,這樣做
我widget.xml文件包含以下內容: -
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Widget"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_margin="8dip"
android:background="@drawable/myshape" >
<AnalogClock android:id="@+id/AnalogClock"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:dial="@drawable/widgetdial"
android:hand_hour="@drawable/widgethour"
android:hand_minute="@drawable/widgetminute"/>
</LinearLayout>
感謝您的親切幫助! :)但我恐怕這並不是我所需要的。我需要一個模擬時鐘作爲小部件顯示,顯示的時間應該與我們選擇的時區不同。我可以這樣做嗎? –
請任何人幫忙! 我看到一個鏈接(http://stackoverflow.com/questions/4630490/how-do-i-set-the-time-on-an-android-analogue-clock)它不可能改變時間的預定義時鐘。因爲它只顯示當前時間。如何創建我們自己的視圖? –
我通過java代碼設置此小部件的時間。所以你可以添加或採取小時價值的東西,你會得到其他小時。你讀過這段代碼嗎? –