[英]Update app widget layout dynamically
我正在基於voip / sip的應用程序上工作,該應用程序可以通過撥號鍵盤小部件撥打電話,該鍵盤底部有四個按鈕
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<ImageButton
android:id="@+id/ibtn_handsfree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_handsfree" />
<ImageButton
android:id="@+id/ibtn_headset"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_headset" />
<ImageButton
android:id="@+id/ibtn_copyToDir"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_copytodir" />
<ImageButton
android:id="@+id/ibtn_keyboard"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_keyboard" />
<ImageButton
android:id="@+id/ibtn_sendkey_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/selector_dialpad_action_button"
android:src="@drawable/selector_send_key_dialer"
/>
</LinearLayout>
感謝您的想法和幫助。
我不知道第一個問題的答案,但是為了切換小部件中按鈕的可見性:
setOnClickPendingIntent
AppWidgetProvider
的onReceive
偵聽該意圖 updateAppWidget
可見性
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.