“_Problem Loading Widget” message

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

    The problem on my side was that I used androidx.appcompat.widget.AppCompatTextView instead of TextView. So no AppCompat widgets in Widget layout. It seems that the Android Widget is so limited.

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

    Check elements you used in the view in a Widget..

    Documentation link

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

    • FrameLayout
    • LinearLayout
    • RelativeLayout
    • GridLayout

    And the following widget classes:

    • AnalogClock
    • Button
    • Chronometer
    • ImageButton
    • ImageView
    • ProgressBar
    • TextView
    • ViewFlipper
    • ListView
    • GridView
    • StackView
    • AdapterViewFlipper

    Using forbidden elements causes this very

    Problem Loading Widget

    message, without saying where did it happen.

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

    In my case I had a floating textView over other views. Removing it and thinking of a different way of showing my info to the user with the existing views that are not overlapping was the solution.

    So don't overlap views with RelativeLayout, I still use it and it works, but the views are not overlapping as much as possible.

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

    I faced this problem because I was trying to use Check-box!

    So,just remove checkbox.

    it will work fine.

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

    I had the same issue but the logcat did not show anything suspicious, neither an error nor a warning. Basically, I was calling a wrong method to change the color of the textview's text.

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

    Just fixed another variant of this error not mentioned in the other answers.

    Symptoms were: 1) "Problem loading widget" error on Gingerbread and below 2) The exact same build ran fine on ICS and Jellybean 3) No errors in logcat

    The problem was caused by manipulating a view that was never inflated in the remoteviews. Specifically:

    remoteviews.setViewVisibility(viewId, View.GONE);

    Where viewId was a valid resource, but it was in a layout that was never added to the remote views. No errors were thrown, and the widget displayed 'Problem loading widget' after the call to .updateAppWidget()

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