“_Problem Loading Widget” message

前端 未结 18 2055
旧巷少年郎
旧巷少年郎 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:38

    Problem Loading the widget results from problem/s in your widget layout!

    There are only limited amount of resource you can use in the widget.Make sure you use the proper elements and their fields.

    A RemoteViews object (and, consequently, an App Widget) can support the following ... widget classes:

    AnalogClock
    Button
    ...
    

    Developer docs

    My problem was: I had this Button's field which was not supported

    android:onClick="onClick" 
    

    Deleting this enabled the widget to appear where placed (if placed previously) and in the menu of available widgets.

    In fact setting android:onClick= for any View results in this error.

提交回复
热议问题