Android app widget not showing up in the List but works smoothly in Android 12 device

649 Views Asked by At

I have developed the widget following the official developer guide - Make a Simple App Widget, and It works as expected for Android 12 devices but fails in Android 11 - not in the listing, and QA team responded that the widget appears but is empty. What could cause these? please help if you are familiar with this.

THis is my appwidget-provider XML file

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:description="@string/payment_app_widget_description"
android:initialKeyguardLayout="@layout/payment_app_widget"
android:initialLayout="@layout/payment_app_widget"
android:minWidth="264dp"
android:minHeight="@dimen/dimen_400dp"
android:previewImage="@drawable/payment_widget_preview"
android:updatePeriodMillis="@integer/mp_payment_app_widget_update_mili"
android:widgetCategory="home_screen"
tools:ignore="ResourceName" />

//EDIT

When decreasing the minHeght to 300dp, it works for all devices. PLease help me understand how to decide on what to provide as height, width.

//EDIT - 2

Actually The issue was something else. I had to set an image from URL to imgaview, and that I wad doing in the main thread only. It worked for scenarios when the URL was empty. SO the Fix was to the store the image already in the file, as the image was also used in other places, and use decodeBitmap(file) and set it into remote view.

0

There are 0 best solutions below