“_Problem Loading Widget” message

前端 未结 18 1741
旧巷少年郎
旧巷少年郎 2021-02-02 06:08

When loading a widget if it cannot find a resource or something it says Problem Loading Widget. That\'s all! Amazing! This message remains on the home screen and does not even s

相关标签:
18条回答
  • 2021-02-02 06:23

    Yet another possible cause of this:

    I saw this in the log:

    Failed to resolve attribute

    The issue was that I was attempting to use a colour from the current theme as the background to one of my layouts.

    e.g

    android:background="?themeColor"
    

    Changing this to a specific colour resolved the issue.

    android:background="@color/White"
    
    0 讨论(0)
  • 2021-02-02 06:23

    I was also having the same problem -

    I was using android.support.constraint.ConstraintLayout that's why it was saying "Problem loading widget" after removing this and changing to LinearLayout problem solved as @Gangnus saying, it will work for only specific views only.

    0 讨论(0)
  • 2021-02-02 06:24

    It may be caused by Moving of the specific (Widget) Application from Internal Memory to SD card.(Android – Fixing “Problem Loading Widget” Error)

    0 讨论(0)
  • 2021-02-02 06:28

    Basically Widgets swallow exceptions. Just set an appropriate filter in your logcat, and you'll be able to see what the problem is...

    Above, I am just searching for the Word "Widget" and setting no filter on any specific application. It essentially gives me the Throwable.getMessage() without the full stack trace.

    0 讨论(0)
  • 2021-02-02 06:28

    There is of course the use-case where there was a widget loaded on the home page and the user then uninstalls the application that contains the widget and widget config app.

    When that happens, all you see is the "Problem Loading Widget" in a toast-like box on the home screen. As far as I can tell, the widget gets no indicatation that the package is being uninstalled and I guess then the home screen AppWidgetManager thows up a default message.

    Not well thought out behaviour on the part of the OS team. I suggest that it would be better to call the widget's onDisbled() and onDestroy() methods before the package is removed so they can tidy up if need be and the user (non-geek phone user) gets a clean experience.

    0 讨论(0)
  • 2021-02-02 06:28

    I had the same issue. Problem resolved: I used custom view in widget. In my situation it was TextView with custom typeface.

    0 讨论(0)
提交回复
热议问题