Udostępnij za pośrednictwem


RemoteViews Class

Definition

A class that describes a view hierarchy that can be displayed in another process.

[Android.Runtime.Register("android/widget/RemoteViews", DoNotGenerateAcw=true)]
public class RemoteViews : Java.Lang.Object, Android.OS.IParcelable, Android.Views.LayoutInflater.IFilter, IDisposable, Java.Interop.IJavaPeerable
[<Android.Runtime.Register("android/widget/RemoteViews", DoNotGenerateAcw=true)>]
type RemoteViews = class
    inherit Object
    interface IParcelable
    interface IJavaObject
    interface IDisposable
    interface IJavaPeerable
    interface LayoutInflater.IFilter
Inheritance
RemoteViews
Attributes
Implements

Remarks

A class that describes a view hierarchy that can be displayed in another process. The hierarchy is inflated from a layout resource file, and this class provides some basic operations for modifying the content of the inflated hierarchy.

RemoteViews is limited to support for the following layouts:

<ul> <li>android.widget.AdapterViewFlipper</li> <li>android.widget.FrameLayout</li> <li>android.widget.GridLayout</li> <li>android.widget.GridView</li> <li>android.widget.LinearLayout</li> <li>android.widget.ListView</li> <li>android.widget.RelativeLayout</li> <li>android.widget.StackView</li> <li>android.widget.ViewFlipper</li> </ul>

And the following widgets:

<ul> <li>android.widget.AnalogClock</li> <li>android.widget.Button</li> <li>android.widget.Chronometer</li> <li>android.widget.ImageButton</li> <li>android.widget.ImageView</li> <li>android.widget.ProgressBar</li> <li>android.widget.TextClock</li> <li>android.widget.TextView</li> </ul>

As of API 31, the following widgets and layouts may also be used:

<ul> <li>android.widget.CheckBox</li> <li>android.widget.RadioButton</li> <li>android.widget.RadioGroup</li> <li>android.widget.Switch</li> </ul>

Descendants of these classes are not supported.

Java documentation for android.widget.RemoteViews.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Constructors

RemoteViews(IDictionary<SizeF,RemoteViews>)

Create a new RemoteViews object that will inflate the layout with the closest size specification.

RemoteViews(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

RemoteViews(Parcel)

Reads a RemoteViews object from a parcel.

RemoteViews(RemoteViews, RemoteViews)

Create a new RemoteViews object that will inflate as the specified landspace or portrait RemoteViews, depending on the current configuration.

RemoteViews(RemoteViews)

Creates a copy of another RemoteViews.

RemoteViews(String, Int32, Int32)

Create a new RemoteViews object that will display the views contained in the specified layout file and change the id of the root view to the specified one.

RemoteViews(String, Int32)

Create a new RemoteViews object that will display the views contained in the specified layout file.

Fields

ExtraChecked

The intent extra for whether the view whose checked state changed is currently checked.

ExtraSharedElementBounds

The intent extra that contains the bounds for all shared elements.

MarginBottom
Obsolete.

The value will apply to the marginBottom.

MarginEnd
Obsolete.

The value will apply to the marginEnd.

MarginLeft
Obsolete.

The value will apply to the marginLeft.

MarginRight
Obsolete.

The value will apply to the marginRight.

MarginStart
Obsolete.

The value will apply to the marginStart.

MarginTop
Obsolete.

The value will apply to the marginTop.

Properties

Class

Returns the runtime class of this Object.

(Inherited from Object)
Creator

Parcelable.

Handle

The handle to the underlying Android instance.

(Inherited from Object)
JniIdentityHashCode (Inherited from Object)
JniPeerMembers
LayoutId

Returns the layout id of the root layout associated with this RemoteViews.

Package
PeerReference (Inherited from Object)
ThresholdClass

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ThresholdType

This API supports the Mono for Android infrastructure and is not intended to be used directly from your code.

ViewId

Get the ID of the top-level view of the XML layout, if set using RemoteViews#RemoteViews(String, int, int).

Methods

AddStableView(Int32, RemoteViews, Int32)

Equivalent to calling ViewGroup#addView(View) after inflating the given RemoteViews.

AddView(Int32, RemoteViews)

Equivalent to calling ViewGroup#addView(View) after inflating the given RemoteViews.

Apply(Context, ViewGroup)

Inflates the view hierarchy represented by this object and applies all of the actions.

Clone()

Returns a deep copy of the RemoteViews object.

DescribeContents()

Describe the kinds of special objects contained in this Parcelable's marshalled representation.

Dispose() (Inherited from Object)
Dispose(Boolean) (Inherited from Object)
Equals(Object)

Indicates whether some other object is "equal to" this one.

(Inherited from Object)
GetHashCode()

Returns a hash code value for the object.

(Inherited from Object)
JavaFinalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

(Inherited from Object)
Notify()

Wakes up a single thread that is waiting on this object's monitor.

(Inherited from Object)
NotifyAll()

Wakes up all threads that are waiting on this object's monitor.

(Inherited from Object)
OnLoadClass(Class)

Used to restrict the views which can be inflated

Reapply(Context, View)

Applies all of the actions to the provided view.

RemoveAllViews(Int32)

Equivalent to calling ViewGroup#removeAllViews().

SetAccessibilityTraversalAfter(Int32, Int32)

Equivalent to calling android.view.View#setAccessibilityTraversalAfter(int).

SetAccessibilityTraversalBefore(Int32, Int32)

Equivalent to calling android.view.View#setAccessibilityTraversalBefore(int).

SetBitmap(Int32, String, Bitmap)

Call a method taking one Bitmap on a view in the layout for this RemoteViews.

SetBlendMode(Int32, String, BlendMode)

Call a method taking one BlendMode on a view in the layout for this RemoteViews.

SetBoolean(Int32, String, Boolean)

Call a method taking one boolean on a view in the layout for this RemoteViews.

SetBundle(Int32, String, Bundle)

Call a method taking one Bundle on a view in the layout for this RemoteViews.

SetByte(Int32, String, SByte)

Call a method taking one byte on a view in the layout for this RemoteViews.

SetChar(Int32, String, Char)

Call a method taking one char on a view in the layout for this RemoteViews.

SetCharSequence(Int32, String, ICharSequence)

Call a method taking one CharSequence on a view in the layout for this RemoteViews.

SetCharSequence(Int32, String, Int32)

Call a method taking one CharSequence on a view in the layout for this RemoteViews.

SetCharSequence(Int32, String, String)

Call a method taking one CharSequence on a view in the layout for this RemoteViews.

SetCharSequenceAttr(Int32, String, Int32)

Call a method taking one CharSequence on a view in the layout for this RemoteViews.

SetChronometer(Int32, Int64, String, Boolean)

Equivalent to calling Chronometer#setBase Chronometer.setBase, Chronometer#setFormat Chronometer.setFormat, and Chronometer#start Chronometer.start() or Chronometer#stop Chronometer.stop().

SetChronometerCountDown(Int32, Boolean)

Equivalent to calling Chronometer#setCountDown(boolean) Chronometer.setCountDown on the chronometer with the given viewId.

SetColor(Int32, String, Int32)

Call a method taking one int, a color, on a view in the layout for this RemoteViews.

SetColorAttr(Int32, String, Int32)

Call a method taking one int, a color, on a view in the layout for this RemoteViews.

SetColorInt(Int32, String, Int32, Int32)

Call a method taking one int, a color, on a view in the layout for this RemoteViews.

SetColorStateList(Int32, String, ColorStateList, ColorStateList)

Call a method taking one ColorStateList on a view in the layout for this RemoteViews.

SetColorStateList(Int32, String, ColorStateList)

Call a method taking one ColorStateList on a view in the layout for this RemoteViews.

SetColorStateList(Int32, String, Int32)

Call a method taking one ColorStateList on a view in the layout for this RemoteViews.

SetColorStateListAttr(Int32, String, Int32)

Call a method taking one ColorStateList on a view in the layout for this RemoteViews.

SetCompoundButtonChecked(Int32, Boolean)

Equivalent to calling android.widget.CompoundButton#setChecked(boolean).

SetContentDescription(Int32, ICharSequence)

Equivalent to calling View.

SetContentDescription(Int32, String)

Equivalent to calling View.

SetDisplayedChild(Int32, Int32)

Equivalent to calling AdapterViewAnimator#setDisplayedChild(int)

SetDouble(Int32, String, Double)

Call a method taking one double on a view in the layout for this RemoteViews.

SetEmptyView(Int32, Int32)

Equivalent to calling AdapterView#setEmptyView(View)

SetFloat(Int32, String, Single)

Call a method taking one float on a view in the layout for this RemoteViews.

SetFloatDimen(Int32, String, Int32)

Call a method taking one float, a size in pixels, on a view in the layout for this RemoteViews.

SetFloatDimen(Int32, String, Single, Int32)

Call a method taking one float, a size in pixels, on a view in the layout for this RemoteViews.

SetFloatDimenAttr(Int32, String, Int32)

Call a method taking one float, a size in pixels, on a view in the layout for this RemoteViews.

SetHandle(IntPtr, JniHandleOwnership)

Sets the Handle property.

(Inherited from Object)
SetIcon(Int32, String, Icon, Icon)

Call a method taking one Icon on a view in the layout for this RemoteViews.

SetIcon(Int32, String, Icon)

Call a method taking one Icon on a view in the layout for this RemoteViews.

SetImageViewBitmap(Int32, Bitmap)

Equivalent to calling ImageView#setImageBitmap(Bitmap)

SetImageViewIcon(Int32, Icon)

Equivalent to calling ImageView#setImageIcon(Icon)

SetImageViewResource(Int32, Int32)

Equivalent to calling ImageView#setImageResource(int)

SetImageViewUri(Int32, Uri)

Equivalent to calling ImageView#setImageURI(Uri)

SetInt(Int32, String, Int32)

Call a method taking one int on a view in the layout for this RemoteViews.

SetIntDimen(Int32, String, Int32)

Call a method taking one int, a size in pixels, on a view in the layout for this RemoteViews.

SetIntDimen(Int32, String, Single, Int32)

Call a method taking one int, a size in pixels, on a view in the layout for this RemoteViews.

SetIntDimenAttr(Int32, String, Int32)

Call a method taking one int, a size in pixels, on a view in the layout for this RemoteViews.

SetIntent(Int32, String, Intent)

Call a method taking one Intent on a view in the layout for this RemoteViews.

SetLabelFor(Int32, Int32)

Equivalent to calling View#setLabelFor(int).

SetLightBackgroundLayoutId(Int32)

Provides an alternate layout ID, which can be used to inflate this view.

SetLong(Int32, String, Int64)

Call a method taking one long on a view in the layout for this RemoteViews.

SetOnCheckedChangeResponse(Int32, RemoteViews+RemoteResponse)

Equivalent to calling android.widget.CompoundButton#setOnCheckedChangeListener( android.widget.CompoundButton.OnCheckedChangeListener) to launch the provided RemoteResponse.

SetOnClickFillInIntent(Int32, Intent)

When using collections (eg.

SetOnClickPendingIntent(Int32, PendingIntent)

Equivalent to calling android.view.View#setOnClickListener(android.view.View.OnClickListener) to launch the provided PendingIntent.

SetOnClickResponse(Int32, RemoteViews+RemoteResponse)

Equivalent of calling android.view.View#setOnClickListener(android.view.View.OnClickListener) to launch the provided RemoteResponse.

SetPendingIntentTemplate(Int32, PendingIntent)

When using collections (eg.

SetProgressBar(Int32, Int32, Int32, Boolean)

Equivalent to calling ProgressBar#setMax ProgressBar.setMax, ProgressBar#setProgress ProgressBar.setProgress, and ProgressBar#setIndeterminate ProgressBar.setIndeterminate

        If indeterminate is true, then the values for max and progress are ignored.
SetRadioGroupChecked(Int32, Int32)

Equivalent to calling android.widget.RadioGroup#check(int).

SetRelativeScrollPosition(Int32, Int32)

Equivalent to calling ListView#smoothScrollByOffset(int).

SetRemoteAdapter(Int32, Int32, Intent)
Obsolete.

Equivalent to calling android.widget.AbsListView#setRemoteViewsAdapter(Intent).

SetRemoteAdapter(Int32, Intent)

Equivalent to calling android.widget.AbsListView#setRemoteViewsAdapter(Intent).

SetRemoteAdapter(Int32, RemoteViews+RemoteCollectionItems)

Equivalent to calling android.widget.AbsListView#setRemoteViewsAdapter(Intent).

SetScrollPosition(Int32, Int32)

Equivalent to calling ListView#smoothScrollToPosition(int).

SetShort(Int32, String, Int16)

Call a method taking one short on a view in the layout for this RemoteViews.

SetString(Int32, String, String)

Call a method taking one String on a view in the layout for this RemoteViews.

SetTextColor(Int32, Color)

Equivalent to calling android.widget.TextView#setTextColor(int).

SetTextViewCompoundDrawables(Int32, Int32, Int32, Int32, Int32)

Equivalent to calling TextView#setCompoundDrawablesWithIntrinsicBounds(int, int, int, int).

SetTextViewCompoundDrawablesRelative(Int32, Int32, Int32, Int32, Int32)

Equivalent to calling TextView#setCompoundDrawablesRelativeWithIntrinsicBounds(int, int, int, int).

SetTextViewText(Int32, ICharSequence)

Equivalent to calling TextView#setText(CharSequence)

SetTextViewText(Int32, String)

Equivalent to calling TextView#setText(CharSequence)

SetTextViewTextSize(Int32, Int32, Single)

Equivalent to calling TextView#setTextSize(int, float)

SetUri(Int32, String, Uri)

Call a method taking one Uri on a view in the layout for this RemoteViews.

SetViewLayoutHeight(Int32, Single, Int32)

Equivalent to setting android.view.ViewGroup.LayoutParams#height except that you may provide the value in any dimension units.

SetViewLayoutHeightAttr(Int32, Int32)

Equivalent to setting android.view.ViewGroup.LayoutParams#height with the value of the given attribute in the current theme.

SetViewLayoutHeightDimen(Int32, Int32)

Equivalent to setting android.view.ViewGroup.LayoutParams#height with the result of Resources#getDimensionPixelSize(int).

SetViewLayoutMargin(Int32, Int32, Single, Int32)

Equivalent to calling MarginLayoutParams#setMarginEnd.

SetViewLayoutMarginAttr(Int32, Int32, Int32)

Equivalent to calling MarginLayoutParams#setMarginEnd.

SetViewLayoutMarginDimen(Int32, Int32, Int32)

Equivalent to calling MarginLayoutParams#setMarginEnd.

SetViewLayoutWidth(Int32, Single, Int32)

Equivalent to setting android.view.ViewGroup.LayoutParams#width except that you may provide the value in any dimension units.

SetViewLayoutWidthAttr(Int32, Int32)

Equivalent to setting android.view.ViewGroup.LayoutParams#width with the value of the given attribute in the current theme.

SetViewLayoutWidthDimen(Int32, Int32)

Equivalent to setting android.view.ViewGroup.LayoutParams#width with the result of Resources#getDimensionPixelSize(int).

SetViewOutlinePreferredRadius(Int32, Single, Int32)

Sets an OutlineProvider on the view whose corner radius is a dimension calculated using TypedValue#applyDimension(int, float, DisplayMetrics).

SetViewOutlinePreferredRadiusAttr(Int32, Int32)

Sets an OutlineProvider on the view whose corner radius is a dimension attribute with attrId.

SetViewOutlinePreferredRadiusDimen(Int32, Int32)

Sets an OutlineProvider on the view whose corner radius is a dimension resource with resId.

SetViewPadding(Int32, Int32, Int32, Int32, Int32)

Equivalent to calling android.view.View#setPadding(int, int, int, int).

SetViewVisibility(Int32, ViewStates)

Equivalent to calling View#setVisibility(int)

ShowNext(Int32)

Equivalent to calling AdapterViewAnimator#showNext()

ShowPrevious(Int32)

Equivalent to calling AdapterViewAnimator#showPrevious()

ToArray<T>() (Inherited from Object)
ToString()

Returns a string representation of the object.

(Inherited from Object)
UnregisterFromRuntime() (Inherited from Object)
Wait()

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>.

(Inherited from Object)
Wait(Int64, Int32)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
Wait(Int64)

Causes the current thread to wait until it is awakened, typically by being <em>notified</em> or <em>interrupted</em>, or until a certain amount of real time has elapsed.

(Inherited from Object)
WriteToParcel(Parcel, ParcelableWriteFlags)

Flatten this object in to a Parcel.

Explicit Interface Implementations

IJavaPeerable.Disposed() (Inherited from Object)
IJavaPeerable.DisposeUnlessReferenced() (Inherited from Object)
IJavaPeerable.Finalized() (Inherited from Object)
IJavaPeerable.JniManagedPeerState (Inherited from Object)
IJavaPeerable.SetJniIdentityHashCode(Int32) (Inherited from Object)
IJavaPeerable.SetJniManagedPeerState(JniManagedPeerStates) (Inherited from Object)
IJavaPeerable.SetPeerReference(JniObjectReference) (Inherited from Object)

Extension Methods

JavaCast<TResult>(IJavaObject)

Performs an Android runtime-checked type conversion.

JavaCast<TResult>(IJavaObject)
GetJniTypeName(IJavaPeerable)

Applies to