Most visited

Recently visited

Added in API level 1

RemoteViews

public class RemoteViews
extends Object implements Parcelable, LayoutInflater.Filter

java.lang.Object
   ↳ android.widget.RemoteViews


描述可以在另一个进程中显示的视图层次结构的类。 层次结构从布局资源文件中膨胀,此类提供了一些用于修改充气层次结构内容的基本操作。

Summary

Nested classes

class RemoteViews.ActionException

执行某个操作时发生错误时发送的例外情况

@interface RemoteViews.RemoteView

这个注释表明View的一个子类被用于RemoteViews机制。

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<RemoteViews> CREATOR

Parcelable.Creator实例化RemoteViews对象

Public constructors

RemoteViews(String packageName, int layoutId)

创建一个新的RemoteViews对象,该对象将显示包含在指定布局文件中的视图。

RemoteViews(RemoteViews landscape, RemoteViews portrait)

根据当前配置创建一个新的RemoteViews对象,该对象将充气为指定的逻辑空间或纵向RemoteViews。

RemoteViews(Parcel parcel)

从宗地中读取RemoteViews对象。

Public methods

void addView(int viewId, RemoteViews nestedView)

相当于调用 addView(View)充气后给予 RemoteViews

View apply(Context context, ViewGroup parent)

膨胀由此对象表示的视图层次并应用所有操作。

RemoteViews clone()

创建并返回此对象的副本。

int describeContents()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

int getLayoutId()

返回与此RemoteView关联的根布局的布局ID。

String getPackage()
boolean onLoadClass(Class clazz)

挂钩以允许LayoutInflater的客户端限制允许被夸大的视图集合。

void reapply(Context context, View v)

将所有操作应用于提供的视图。

void removeAllViews(int viewId)

相当于拨打 removeAllViews()

void setAccessibilityTraversalAfter(int viewId, int nextId)

相当于拨打 setAccessibilityTraversalAfter(int)

void setAccessibilityTraversalBefore(int viewId, int nextId)

相当于拨打 setAccessibilityTraversalBefore(int)

void setBitmap(int viewId, String methodName, Bitmap value)

在此RemoteViews的布局视图中调用一个采用一个位图的方法。

void setBoolean(int viewId, String methodName, boolean value)

在这个RemoteViews的布局的视图中调用一个采用一个布尔值的方法。

void setBundle(int viewId, String methodName, Bundle value)

在此RemoteViews的布局的视图中调用一个采用一个Bundle的方法。

void setByte(int viewId, String methodName, byte value)

在此RemoteViews的布局中,调用视图中占用一个字节的方法。

void setChar(int viewId, String methodName, char value)

在这个RemoteViews的布局中调用一个视图上的一个字符的方法。

void setCharSequence(int viewId, String methodName, CharSequence value)

调用此RemoteViews的布局中的视图上的一个CharSequence。

void setChronometer(int viewId, long base, String format, boolean started)

相当于调用 Chronometer.setBaseChronometer.setFormat ,并 Chronometer.start()或者 Chronometer.stop()

void setChronometerCountDown(int viewId, boolean isCountDown)

相当于在具有给定viewId的计时器上调用 Chronometer.setCountDown

void setContentDescription(int viewId, CharSequence contentDescription)

相当于调用View.setContentDescription(CharSequence)。

void setDisplayedChild(int viewId, int childIndex)

相当于拨打 setDisplayedChild(int)

void setDouble(int viewId, String methodName, double value)

在这个RemoteViews的布局中调用一个在视图中占用一倍的方法。

void setEmptyView(int viewId, int emptyViewId)

相当于调用AdapterView.setEmptyView

void setFloat(int viewId, String methodName, float value)

调用此RemoteViews的布局中的视图上的浮动视图。

void setIcon(int viewId, String methodName, Icon value)

调用此RemoteViews的布局中的视图上的一个图标。

void setImageViewBitmap(int viewId, Bitmap bitmap)

相当于调用ImageView.setImageBitmap

void setImageViewIcon(int viewId, Icon icon)

相当于调用ImageView.setImageIcon

void setImageViewResource(int viewId, int srcId)

相当于调用ImageView.setImageResource

void setImageViewUri(int viewId, Uri uri)

等同于调用ImageView.setImageURI

void setInt(int viewId, String methodName, int value)

调用此RemoteViews的布局视图中的一个int值的方法。

void setIntent(int viewId, String methodName, Intent value)

在此RemoteViews的布局的视图中调用一个采用一个Intent的方法。

void setLabelFor(int viewId, int labeledId)

相当于调用View.setLabelFor(int)。

void setLong(int viewId, String methodName, long value)

在这个RemoteViews的布局的视图中调用一个占用一个long的方法。

void setOnClickFillInIntent(int viewId, Intent fillInIntent)

当使用集合(例如。

void setOnClickPendingIntent(int viewId, PendingIntent pendingIntent)

相当于拨打 setOnClickListener(android.view.View.OnClickListener)启动提供的 PendingIntent

void setPendingIntentTemplate(int viewId, PendingIntent pendingIntentTemplate)

当使用集合(例如。

void setProgressBar(int viewId, int max, int progress, boolean indeterminate)

相当于调用 ProgressBar.setMaxProgressBar.setProgress ,并 ProgressBar.setIndeterminate如果不确定是真实的,那么对于max和进步的价值被忽略。

void setRelativeScrollPosition(int viewId, int offset)

相当于拨打 smoothScrollToPosition(int, int)

void setRemoteAdapter(int appWidgetId, int viewId, Intent intent)

此方法在API级别14中已被弃用。此方法已被弃用。 setRemoteAdapter(int, Intent)

void setRemoteAdapter(int viewId, Intent intent)

相当于拨打 setRemoteViewsAdapter(Intent)

void setScrollPosition(int viewId, int position)

相当于拨打 smoothScrollToPosition(int, int)

void setShort(int viewId, String methodName, short value)

在这个RemoteViews的布局的视图中调用一个简短的方法。

void setString(int viewId, String methodName, String value)

在此RemoteViews的布局的视图中调用一个采用一个字符串的方法。

void setTextColor(int viewId, int color)

相当于拨打 setTextColor(int)

void setTextViewCompoundDrawables(int viewId, int left, int top, int right, int bottom)

相当于拨打 setCompoundDrawablesWithIntrinsicBounds(int, int, int, int)

void setTextViewCompoundDrawablesRelative(int viewId, int start, int top, int end, int bottom)

相当于拨打 setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int)

void setTextViewText(int viewId, CharSequence text)

相当于调用TextView.setText

void setTextViewTextSize(int viewId, int units, float size)

相当于拨打 setTextSize(int, float)

void setUri(int viewId, String methodName, Uri value)

在这个RemoteViews的布局的视图中调用一个采用一个Uri的方法。

void setViewPadding(int viewId, int left, int top, int right, int bottom)

相当于拨打 setPadding(int, int, int, int)

void setViewVisibility(int viewId, int visibility)

等同于调用View.setVisibility

void showNext(int viewId)

相当于拨打 showNext()

void showPrevious(int viewId)

相当于拨打 showPrevious()

void writeToParcel(Parcel dest, int flags)

将此对象平铺到一个包裹中。

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable
From interface android.view.LayoutInflater.Filter

Fields

CREATOR

Added in API level 1
Creator<RemoteViews> CREATOR

Parcelable.Creator实例化RemoteViews对象

Public constructors

RemoteViews

Added in API level 1
RemoteViews (String packageName, 
                int layoutId)

创建一个新的RemoteViews对象,该对象将显示包含在指定布局文件中的视图。

Parameters
packageName String: Name of the package that contains the layout resource
layoutId int: The id of the layout resource

RemoteViews

Added in API level 16
RemoteViews (RemoteViews landscape, 
                RemoteViews portrait)

根据当前配置创建一个新的RemoteViews对象,该对象将充气为指定的逻辑空间或纵向RemoteViews。

Parameters
landscape RemoteViews: The RemoteViews to inflate in landscape configuration
portrait RemoteViews: The RemoteViews to inflate in portrait configuration

RemoteViews

Added in API level 1
RemoteViews (Parcel parcel)

从宗地中读取RemoteViews对象。

Public methods

addView

Added in API level 7
void addView (int viewId, 
                RemoteViews nestedView)

相当于调用addView(View)充气后给予RemoteViews 这允许用户构建“嵌套” RemoteViews 如果RemoteViews消费者可能回收布局,请使用removeAllViews(int)清除任何现有的孩子。

Parameters
viewId int: The id of the parent ViewGroup to add child into.
nestedView RemoteViews: RemoteViews that describes the child.

apply

Added in API level 1
View apply (Context context, 
                ViewGroup parent)

膨胀由此对象表示的视图层次并应用所有操作。

来电者小心:这可能会抛出

Parameters
context Context: Default context to use
parent ViewGroup: Parent that the resulting view hierarchy will be attached to. This method does not attach the hierarchy. The caller should do so when appropriate.
Returns
View The inflated view hierarchy

clone

Added in API level 1
RemoteViews clone ()

创建并返回此对象的副本。 “复制”的确切含义可能取决于对象的类别。 一般意图是,对于任何对象x ,表达式:

 x.clone() != x
will be true, and that the expression:
 x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
 x.clone().equals(x)
will be true, this is not an absolute requirement.

按照惯例,返回的对象应该通过调用super.clone来获得。 如果一个类和它的所有超类( Object除外)都遵守这个约定,那将是这样的情况,即x.clone().getClass() == x.getClass()

按照惯例,这个方法返回的对象应该独立于这个对象(被克隆)。 为了实现这种独立性,可能需要在返回super.clone之前修改对象的一个或多个字段。 通常,这意味着复制包含被克隆对象的内部“深层结构”的任何可变对象,并将这些对象的引用替换为对这些副本的引用。 如果一个类仅包含原始字段或对不可变对象的引用,那么通常情况下不需要修改super.clone返回的对象中的字段。

Object的方法clone执行特定的克隆操作。 首先,如果该对象的类没有实现接口Cloneable ,则引发CloneNotSupportedException 请注意,所有数组都被视为实现接口Cloneable并且数组类型T[]clone方法的返回类型为T[] ,其中T是任何引用或基本类型。 否则,此方法创建该对象的类的新实例,并使用该对象的相应字段的内容来初始化其所有字段,就像通过赋值一样; 这些字段的内容本身并不克隆。 因此,此方法执行此对象的“浅拷贝”,而不是“深拷贝”操作。

Object本身并未实现接口 Cloneable ,因此在类 Object的对象上调用 clone方法将导致在运行时抛出异常。

Returns
RemoteViews a clone of this instance.

describeContents

Added in API level 1
int describeContents ()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getLayoutId

Added in API level 1
int getLayoutId ()

返回与此RemoteView关联的根布局的布局ID。 在RemoteViews同时具有横向和纵向根的情况下,这将返回与纵向布局关联的布局ID。

Returns
int the layout id.

getPackage

Added in API level 1
String getPackage ()

Returns
String

onLoadClass

Added in API level 1
boolean onLoadClass (Class clazz)

挂钩以允许LayoutInflater的客户端限制允许被夸大的视图集合。

Parameters
clazz Class: The class object for the View that is about to be inflated
Returns
boolean True if this class is allowed to be inflated, or false otherwise

reapply

Added in API level 1
void reapply (Context context, 
                View v)

将所有操作应用于提供的视图。

来电者小心:这可能会抛出

Parameters
context Context
v View: The view to apply the actions to. This should be the result of the apply(Context, ViewGroup) call.

removeAllViews

Added in API level 7
void removeAllViews (int viewId)

相当于拨打 removeAllViews()

Parameters
viewId int: The id of the parent ViewGroup to remove all children from.

setAccessibilityTraversalAfter

Added in API level 22
void setAccessibilityTraversalAfter (int viewId, 
                int nextId)

相当于拨打 setAccessibilityTraversalAfter(int)

Parameters
viewId int: The id of the view whose after view in accessibility traversal to set.
nextId int: The id of the next in the accessibility traversal.

setAccessibilityTraversalBefore

Added in API level 22
void setAccessibilityTraversalBefore (int viewId, 
                int nextId)

相当于拨打 setAccessibilityTraversalBefore(int)

Parameters
viewId int: The id of the view whose before view in accessibility traversal to set.
nextId int: The id of the next in the accessibility traversal.

setBitmap

Added in API level 3
void setBitmap (int viewId, 
                String methodName, 
                Bitmap value)

在此RemoteViews的布局视图中调用一个采用一个位图的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value Bitmap: The value to pass to the method.

setBoolean

Added in API level 3
void setBoolean (int viewId, 
                String methodName, 
                boolean value)

在这个RemoteViews的布局的视图中调用一个采用一个布尔值的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value boolean: The value to pass to the method.

setBundle

Added in API level 8
void setBundle (int viewId, 
                String methodName, 
                Bundle value)

在此RemoteViews的布局的视图中调用一个采用一个Bundle的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value Bundle: The value to pass to the method.

setByte

Added in API level 3
void setByte (int viewId, 
                String methodName, 
                byte value)

在此RemoteViews的布局中,调用视图中占用一个字节的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value byte: The value to pass to the method.

setChar

Added in API level 3
void setChar (int viewId, 
                String methodName, 
                char value)

在这个RemoteViews的布局中调用一个视图上的一个字符的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value char: The value to pass to the method.

setCharSequence

Added in API level 3
void setCharSequence (int viewId, 
                String methodName, 
                CharSequence value)

调用此RemoteViews的布局中的视图上的一个CharSequence。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value CharSequence: The value to pass to the method.

setChronometer

Added in API level 1
void setChronometer (int viewId, 
                long base, 
                String format, 
                boolean started)

相当于调用 Chronometer.setBaseChronometer.setFormat ,并 Chronometer.start()或者 Chronometer.stop()

Parameters
viewId int: The id of the Chronometer to change
base long: The time at which the timer would have read 0:00. This time should be based off of SystemClock.elapsedRealtime().
format String: The Chronometer format string, or null to simply display the timer value.
started boolean: True if you want the clock to be started, false if not.

也可以看看:

setChronometerCountDown

Added in API level 24
void setChronometerCountDown (int viewId, 
                boolean isCountDown)

相当于在具有给定viewId的计时器上调用 Chronometer.setCountDown

Parameters
viewId int: The id of the Chronometer to change
isCountDown boolean: True if you want the chronometer to count down to base instead of counting up.

setContentDescription

Added in API level 15
void setContentDescription (int viewId, 
                CharSequence contentDescription)

相当于调用View.setContentDescription(CharSequence)。

Parameters
viewId int: The id of the view whose content description should change.
contentDescription CharSequence: The new content description for the view.

setDisplayedChild

Added in API level 12
void setDisplayedChild (int viewId, 
                int childIndex)

相当于拨打 setDisplayedChild(int)

Parameters
viewId int: The id of the view on which to call setDisplayedChild(int)
childIndex int

setDouble

Added in API level 3
void setDouble (int viewId, 
                String methodName, 
                double value)

在这个RemoteViews的布局中调用一个在视图中占用一倍的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value double: The value to pass to the method.

setEmptyView

Added in API level 11
void setEmptyView (int viewId, 
                int emptyViewId)

相当于调用AdapterView.setEmptyView

Parameters
viewId int: The id of the view on which to set the empty view
emptyViewId int: The view id of the empty view

setFloat

Added in API level 3
void setFloat (int viewId, 
                String methodName, 
                float value)

调用此RemoteViews的布局中的视图上的浮动视图。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value float: The value to pass to the method.

setIcon

Added in API level 23
void setIcon (int viewId, 
                String methodName, 
                Icon value)

调用此RemoteViews的布局中的视图上的一个图标。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value Icon: The Icon to pass the method.

setImageViewBitmap

Added in API level 3
void setImageViewBitmap (int viewId, 
                Bitmap bitmap)

相当于调用ImageView.setImageBitmap

Parameters
viewId int: The id of the view whose bitmap should change
bitmap Bitmap: The new Bitmap for the drawable

setImageViewIcon

Added in API level 23
void setImageViewIcon (int viewId, 
                Icon icon)

相当于调用ImageView.setImageIcon

Parameters
viewId int: The id of the view whose bitmap should change
icon Icon: The new Icon for the ImageView

setImageViewResource

Added in API level 1
void setImageViewResource (int viewId, 
                int srcId)

相当于调用ImageView.setImageResource

Parameters
viewId int: The id of the view whose drawable should change
srcId int: The new resource id for the drawable

setImageViewUri

Added in API level 1
void setImageViewUri (int viewId, 
                Uri uri)

等同于调用ImageView.setImageURI

Parameters
viewId int: The id of the view whose drawable should change
uri Uri: The Uri for the image

setInt

Added in API level 3
void setInt (int viewId, 
                String methodName, 
                int value)

调用此RemoteViews的布局视图中的一个int值的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value int: The value to pass to the method.

setIntent

Added in API level 11
void setIntent (int viewId, 
                String methodName, 
                Intent value)

在此RemoteViews的布局的视图中调用一个采用一个Intent的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value Intent: The Intent to pass the method.

setLabelFor

Added in API level 17
void setLabelFor (int viewId, 
                int labeledId)

相当于调用View.setLabelFor(int)。

Parameters
viewId int: The id of the view whose property to set.
labeledId int: The id of a view for which this view serves as a label.

setLong

Added in API level 3
void setLong (int viewId, 
                String methodName, 
                long value)

在这个RemoteViews的布局的视图中调用一个占用一个long的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value long: The value to pass to the method.

setOnClickFillInIntent

Added in API level 11
void setOnClickFillInIntent (int viewId, 
                Intent fillInIntent)

当使用集合(例如ListViewStackView等)在窗口小部件,它是非常昂贵的对单个项目设置PendingIntents,并且因此不允许的。 相反,可以在集合上设置单个PendingIntent模板,请参阅setPendingIntentTemplate(int, PendingIntent) ,并且可以通过在该项目上设置fillInIntent来区分给定项目的单个单击操作。 然后将fillInIntent与PendingIntent模板组合,以确定单击该项目时将执行的最终意图。 它的工作原理如下:任何在PendingIntent模板中留白但由fillInIntent提供的字段将被覆盖,并且将使用生成的PendingIntent。 PendingIntent模板的相关字段将填充fillInIntent中设置的相关字段。 有关更多详细信息,请参阅fillIn(Intent, int)

Parameters
viewId int: The id of the view on which to set the fillInIntent
fillInIntent Intent: The intent which will be combined with the parent's PendingIntent in order to determine the on-click behavior of the view specified by viewId

setOnClickPendingIntent

Added in API level 3
void setOnClickPendingIntent (int viewId, 
                PendingIntent pendingIntent)

相当于拨打setOnClickListener(android.view.View.OnClickListener)启动提供的PendingIntent 设置项目的集合内的点击动作(如ListViewStackView等),这种方法是行不通的。 相反,使用{@link RemoteViews#setPendingIntentTemplate(int,PendingIntent)与RemoteViews#setOnClickFillInIntent(int,Intent)结合使用。

Parameters
viewId int: The id of the view that will trigger the PendingIntent when clicked
pendingIntent PendingIntent: The PendingIntent to send when user clicks

setPendingIntentTemplate

Added in API level 11
void setPendingIntentTemplate (int viewId, 
                PendingIntent pendingIntentTemplate)

当使用集合(例如ListViewStackView等)在窗口小部件,它是非常昂贵的对单个项目设置PendingIntents,并且因此不允许的。 相反,应该使用此方法在集合上设置单个PendingIntent模板,并且使用setOnClickFillInIntent(int, Intent)可以区分单个项目的点击行为。

Parameters
viewId int: The id of the collection who's children will use this PendingIntent template when clicked
pendingIntentTemplate PendingIntent: The PendingIntent to be combined with extras specified by a child of viewId and executed when that child is clicked

setProgressBar

Added in API level 1
void setProgressBar (int viewId, 
                int max, 
                int progress, 
                boolean indeterminate)

相当于调用 ProgressBar.setMaxProgressBar.setProgress ,并 ProgressBar.setIndeterminate如果不确定是真实的,那么对于max和进步的价值被忽略。

Parameters
viewId int: The id of the ProgressBar to change
max int: The 100% value for the progress bar
progress int: The current value of the progress bar.
indeterminate boolean: True if the progress bar is indeterminate, false if not.

setRelativeScrollPosition

Added in API level 11
void setRelativeScrollPosition (int viewId, 
                int offset)

相当于拨打 smoothScrollToPosition(int, int)

Parameters
viewId int: The id of the view to change
offset int: Scroll by this adapter position offset

setRemoteAdapter

Added in API level 11
void setRemoteAdapter (int appWidgetId, 
                int viewId, 
                Intent intent)

此方法在API级别14中已弃用。
此方法已被弃用。 setRemoteAdapter(int, Intent)

相当于拨打 setRemoteViewsAdapter(Intent)

Parameters
appWidgetId int: The id of the app widget which contains the specified view. (This parameter is ignored in this deprecated method)
viewId int: The id of the AdapterView
intent Intent: The intent of the service which will be providing data to the RemoteViewsAdapter

setRemoteAdapter

Added in API level 14
void setRemoteAdapter (int viewId, 
                Intent intent)

相当于拨打setRemoteViewsAdapter(Intent) 只能用于App Widgets。

Parameters
viewId int: The id of the AdapterView
intent Intent: The intent of the service which will be providing data to the RemoteViewsAdapter

setScrollPosition

Added in API level 11
void setScrollPosition (int viewId, 
                int position)

相当于拨打 smoothScrollToPosition(int, int)

Parameters
viewId int: The id of the view to change
position int: Scroll to this adapter position

setShort

Added in API level 3
void setShort (int viewId, 
                String methodName, 
                short value)

在这个RemoteViews的布局的视图中调用一个简短的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value short: The value to pass to the method.

setString

Added in API level 3
void setString (int viewId, 
                String methodName, 
                String value)

在此RemoteViews的布局的视图中调用一个采用一个字符串的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value String: The value to pass to the method.

setTextColor

Added in API level 3
void setTextColor (int viewId, 
                int color)

相当于拨打 setTextColor(int)

Parameters
viewId int: The id of the view whose text color should change
color int: Sets the text color for all the states (normal, selected, focused) to be this color.

setTextViewCompoundDrawables

Added in API level 16
void setTextViewCompoundDrawables (int viewId, 
                int left, 
                int top, 
                int right, 
                int bottom)

相当于拨打 setCompoundDrawablesWithIntrinsicBounds(int, int, int, int)

Parameters
viewId int: The id of the view whose text should change
left int: The id of a drawable to place to the left of the text, or 0
top int: The id of a drawable to place above the text, or 0
right int: The id of a drawable to place to the right of the text, or 0
bottom int: The id of a drawable to place below the text, or 0

setTextViewCompoundDrawablesRelative

Added in API level 16
void setTextViewCompoundDrawablesRelative (int viewId, 
                int start, 
                int top, 
                int end, 
                int bottom)

相当于拨打 setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int)

Parameters
viewId int: The id of the view whose text should change
start int: The id of a drawable to place before the text (relative to the layout direction), or 0
top int: The id of a drawable to place above the text, or 0
end int: The id of a drawable to place after the text, or 0
bottom int: The id of a drawable to place below the text, or 0

setTextViewText

Added in API level 1
void setTextViewText (int viewId, 
                CharSequence text)

相当于调用TextView.setText

Parameters
viewId int: The id of the view whose text should change
text CharSequence: The new text for the view

setTextViewTextSize

Added in API level 16
void setTextViewTextSize (int viewId, 
                int units, 
                float size)

相当于拨打 setTextSize(int, float)

Parameters
viewId int: The id of the view whose text size should change
units int: The units of size (e.g. COMPLEX_UNIT_SP)
size float: The size of the text

setUri

Added in API level 3
void setUri (int viewId, 
                String methodName, 
                Uri value)

在这个RemoteViews的布局的视图中调用一个采用一个Uri的方法。

Parameters
viewId int: The id of the view on which to call the method.
methodName String: The name of the method to call.
value Uri: The value to pass to the method.

setViewPadding

Added in API level 16
void setViewPadding (int viewId, 
                int left, 
                int top, 
                int right, 
                int bottom)

相当于拨打 setPadding(int, int, int, int)

Parameters
viewId int: The id of the view to change
left int: the left padding in pixels
top int: the top padding in pixels
right int: the right padding in pixels
bottom int: the bottom padding in pixels

setViewVisibility

Added in API level 1
void setViewVisibility (int viewId, 
                int visibility)

等同于调用View.setVisibility

Parameters
viewId int: The id of the view whose visibility should change
visibility int: The new visibility for the view

showNext

Added in API level 11
void showNext (int viewId)

相当于拨打 showNext()

Parameters
viewId int: The id of the view on which to call showNext()

showPrevious

Added in API level 11
void showPrevious (int viewId)

相当于拨打 showPrevious()

Parameters
viewId int: The id of the view on which to call showPrevious()

writeToParcel

Added in API level 1
void writeToParcel (Parcel dest, 
                int flags)

将此对象平铺到一个包裹中。

Parameters
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!