title:

Widget Preview not work on One UI 6

(Post creation time:  

12-3-2023 02:22 AM

)

452 Views

D

driod_dev

Beginner Level 2

last edited

 

12-3-2023 02:22 AM

 

in

 

I found the flag  AppWidgetManager#EXTRA_APPWIDGET_PREVIEW  not working with One UI 6 when developing a widget app.

https://developer.android.com/reference/android/appwidget/AppWidgetManager#EXTRA_APPWIDGET_PREVIEW 

demo code

Bundle b = new Bundle();

RemoteViews remoteViews = new RemoteViews(getPackageName(), R.layout.widget_layout);

b.putParcelable(AppWidgetManager.EXTRA_APPWIDGET_PREVIEW, remoteViews);

mAppWidgetManager.requestPinAppWidget(myProvider, b, null);

 

 

 

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...