简体   繁体   English

Android小部件仅在模拟器上有效,而不能在真实设备上有效

[英]Android widget works only on emulator not on real device

The widget is working perfectly on emulator 4.1.2, when installed on a real device it doesn't even show on the widget list, just as installed but I cant get it to work properly. 该小部件在模拟器4.1.2上可以正常运行,当安装在真实设备上时,它甚至没有显示在小部件列表中,就像安装时一样,但我无法使其正常工作。

here's the manifest.xml 这是manifest.xml

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.staccato.conectauaem"
android:versionCode="1"
android:versionName="1.0" >

<uses-sdk
    android:minSdkVersion="8"
    android:targetSdkVersion="17" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme">

    <receiver android:name="WgtProvider" >
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>

        <meta-data
            android:name="android.appwidget.provider"
            android:resource="@xml/appwidget" />
    </receiver>

    <receiver
        android:name="WgtReceiver"
        android:label="widgetBroadcastReceiver" >
        <intent-filter>
            <action android:name="com.staccato.intent.action.CONNECT" />
        </intent-filter>

        <meta-data
            android:name="android.appwidget.provider"
            android:resource="@xml/appwidget" />
    </receiver>
</application>

</manifest>

and the widget provider 和小部件提供商

<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:initialLayout="@layout/main"
    android:minHeight="47dp"
    android:minResizeHeight="146dp"
    android:minResizeWidth="146dp"
    android:minWidth="47dp"
    android:updatePeriodMillis="1000000" >
</appwidget-provider>

解决了硬重置,安装了小部件,然后重新启动设备,然后将其显示在小部件列表中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 android 应用程序适用于模拟器但不适用于真实设备 - android app works on emulator but not in real device Android应用程序可以在模拟器上正常运行,但不能在真实设备上运行 - Android Application works fine on emulator but not on a real device Android Studio 应用程序可以在模拟器中运行,但不能在真实设备上运行 - Android Studio app works in emulator but not on a real device 尝试在 Android 设备上检索位置...适用于模拟器但不适用于真实设备 - Attempting to retrieve location on Android Device... works on emulator but not real device 应用程序可在模拟器上运行,但不能在真实设备上运行 - App works on emulator but not real device 应用程序可以在模拟器上运行,但不能在真实设备上运行 - App works on emulator but not on real device Android HttpsURLConnection 适用于模拟器上的自签名证书,但不适用于真实设备 - Android HttpsURLConnection works with self-signed certificate on emulator but not on real device Android应用程序可在模拟器上正常运行,但在真实设备上崩溃 - Android Application works correctly on emulator but crashes on real device Android Studio 应用程序在真实设备上崩溃,但可在模拟器上运行 - Android Studio app crashes on real device, but works on emulator android AppWidget:SMS查询可在模拟器上运行,但不能在真实设备上运行 - android AppWidget: SMS query works on emulator, but not on a real device
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM