android / user-interface-samples

Multiple samples showing the best practices in the user interface on Android.
Apache License 2.0
4.33k stars 1.63k forks source link

AppWidgetPinnedReceiver not work on Redmi device #457

Open DawnNguyenAhiho opened 4 months ago

DawnNguyenAhiho commented 4 months ago

Hi, I'm having some issue when running your sample code AppWidget on Redmi device. The AppWidgetPinnedReceiver is not work on every Redmi device. After add widget to home screen, there is no Toast shown up (when it should have a Toast with message "Widget pinned. Go to homescreen.". I think the problem is successCallback (at MainActivity, private fun AppWidgetProviderInfo.pin(context: Context)) is not call after requestPinAppWidget is run and pinned successfully.