我在這裏有一個基本的時鐘小工具,它在4.0以下的Android版本上工作得很好,你可以長按,選擇小工具和它的權利。但是,當我嘗試在4.0或更高版本的仿真器或實際設備上運行它時,它不會在設置>存儲>應用程序中的小部件部分中顯示。我曾嘗試添加一個簡單的活動,只是給用戶指示如何安裝小部件,該建議作爲答案在這裏給出:Android 4.0: widgets not appearing?。除非我做錯了,小部件仍然不會顯示在小部件抽屜中。Android 4.0+中未顯示的小工具
這裏是我的清單:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.widgetexample1"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="14" />
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity android:name=".MainActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".ExampleAppWidgetProvider"
android:label="8-bit cloud widget 1">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="@xml/widget1_info" />
</receiver>
</application>
</manifest>
至今還沒有找到一個解決方案,幫助將不勝感激。 – 2012-08-06 18:35:37
也許這可以幫助你http://stackoverflow.com/questions/8794952/android-4-0-widgets-not-appearing 我現在有同樣的問題。 – 2012-10-17 08:16:55