What views can I use in appWidget?

Can someone tell me what kinds I can use in appWidget?

Thank!

+3
source share
3 answers

See the article article on widgets for applications on the Android developers site for a list of layouts and views available for use in widgets.

+3
source

according to the official android API :

The RemoteViews object (and therefore the App widget) can support the following layout classes:

  • Framelayout
  • Linearlayout
  • RelativeLayout
  • Gridlayout

And the following widget classes:

  • Analoglock
  • Button
  • Chronometer
  • Imagebutton
  • Imageview
  • Progressbar
  • Textview
  • ViewFlipper
  • Listview
  • Gridview
  • StackView
  • AdapterViewFlipper

.

RemoteViews ViewStub, , .

android 3.0 :

  • ListView - , . , . Gmail.
  • GridView - , . , . "".
  • StackView - ( rolodex), /, / , . YouTube Books.
  • AdapterViewFlipper - ViewAnimator , . .
+5

, , , . , (?) . , (TextView), :

WARN/AppWidgetHostView (606): android.widget.RemoteViews $ActionException: view: android.widget.TextView RemoteViews: setBackgroundColor (int)

I still do not see the final list of what is and is not supported. In the list of androids-dev there were several threads ( one , two ) on this topic, but not much more. work-arounds are not so great.

0
source

Source: https://habr.com/ru/post/1727958/


All Articles