Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: Widgets not showing in app drawer ICS

I have two widgets and neither of them will show up in the app drawer. What's weird is that if I remove one from the manifest it won't show up either but I can't see what I am doing wrong. From all the other questions I searched it looks right. The app is not being installed on the SD card.

Anyone have any ideas?

AndroidManifest.xml

<receiver
        android:name=".appwidgets.WidgetLarge"
        android:label="@string/Widget_large"
        android:icon="@drawable/icon" >
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.groggs.action.CACHE_UPDATE_FINISHED" />
        </intent-filter>
        <intent-filter>
            <action android:name="WIDGET_UPDATE" />
            <data android:scheme="content" />
        </intent-filter>

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

    <receiver
        android:name=".appwidgets.WidgetSmall"
        android:label="@string/Widget_small"
        android:icon="@drawable/icon" >
        <intent-filter>
            <action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
        </intent-filter>
        <intent-filter>
            <action android:name="com.groggs.action.CACHE_UPDATE_FINISHED" />
        </intent-filter>
        <intent-filter>
            <action android:name="WIDGET_UPDATE" />

            <data android:scheme="content" />
        </intent-filter>

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

widget_large_info.xml

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:maxWidth="450dp"
    android:maxHeight="352dp" 
    android:updatePeriodMillis="0"
    android:initialLayout="@layout/widget_layout_large"
    android:configure="com.groggs.appwidgets.config.HubQuickViewWidgetConfig" >
</appwidget-provider>

widget_small_info.xml

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
    android:maxWidth="450dp"
    android:maxHeight="82dp" 
    android:updatePeriodMillis="0"
    android:initialLayout="@layout/widget_layout_small"
    android:configure="com.groggs.appwidgets.config.HubQuickViewWidgetConfig" >
</appwidget-provider>
like image 342
FuegoFingers Avatar asked Feb 10 '12 18:02

FuegoFingers


People also ask

Why are my widgets not showing up Android?

The most common reason for a widget to disappear is when Android users transfer applications to a memory card. Widgets may also disappear after the hard reboot of your device. To return it, you need to transfer them again to the phone's memory.

Where is the widget drawer?

First, touch hold an open space on your home screen. You'll see an option at the bottom of the screen to view the widgets drawer, which is where they dwell until summoned for duty.

What is a widget drawer?

Widget Drawer is an Android app that lets you access your widgets from anywhere. Widgets have been a staple among Android users for years, but where we can place those widgets has changed.


1 Answers

Add "minHeight" and "minWidth" attributes to your appwidget-provider elements for each of your appwidgets and see if this does the trick for you.

If you check logcat when running it in the emulator, you should notice the launcher outputting a message about invalid dimensions and the name of your widget will be attached to this line.

I just had this issue and this is how I solved it (although I had one min and on max provided on accident). The logcat message said I had a dimension of (108, 0). This lead me into looking at all my dimensions since it was yelling at me for height being 0.

This was my post: App Widget not displaying in ICS app drawer

like image 190
esilac Avatar answered Sep 17 '22 16:09

esilac