Why should i use RemoteViews for Android home scre

2019-05-12 03:50发布

问题:

Hello i'm trying to realize an Android home screen widget; just a question: why should i use RemoteViews in implementing widgets?

Thanks in advance

回答1:

Refer this link site.

Creating the App Widget layout is simple if you're familiar with Declaring Layout in XML. However, you must be aware that App Widget layouts are based on RemoteViews, which do not support every kind of layout or view widget.

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

FrameLayout
LinearLayout
RelativeLayout

And the following widget classes:

AnalogClock
Button
Chronometer
ImageButton
ImageView
ProgressBar
TextView

Descendants of these classes are not supported.