android.widget.RemoteViews
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.
Nested Classes
Summary
Constants
Public Constructors
Public Methods
|
|
|
|
|
View |
apply(Context context, ViewGroup parent) |
|
|
|
|
|
int |
describeContents() |
|
|
|
|
|
int |
getLayoutId() |
|
|
|
|
|
String |
getPackage() |
|
|
|
|
|
boolean |
onLoadClass(Class clazz) |
|
|
|
|
|
void |
reapply(Context context, View v) |
|
|
|
|
|
void |
setChronometer(int viewId, long base, String format, boolean running) |
|
|
|
|
|
void |
setImageViewResource(int viewId, int srcId) |
|
|
|
|
|
void |
setImageViewUri(int viewId, Uri uri) |
|
|
|
|
|
void |
setProgressBar(int viewId, int max, int progress, boolean indeterminate) |
|
|
|
|
|
void |
setTextViewText(int viewId, CharSequence text) |
|
|
|
|
|
void |
setViewVisibility(int viewId, int visibility) |
|
|
|
|
|
void |
writeToParcel(Parcel dest, int flags) |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
Details
Constants
Parcelable.Creator that instantiates RemoteViews objects
Public Constructors
public
RemoteViews(String packageName, int layoutId)
Create a new RemoteViews object that will display the views contained
in the specified layout file.
Parameters
packageName
| Name of the package that contains the layout resource |
layoutId
| The id of the layout resource
|
public
RemoteViews(Parcel parcel)
Reads a RemoteViews object from a parcel.
Public Methods
Inflates the view hierarchy represented by this object and applies
all of the actions.
Caller beware: this may throw
Parameters
context
| Default context to use |
parent
| 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
- The inflated view hierarchy
public
int
describeContents()
Describe the kinds of special objects contained in this Parcelable's
marshalled representation.
public
boolean
onLoadClass(Class clazz)
Hook to allow clients of the LayoutInflater to restrict the set of Views
that are allowed to be inflated.
public
void
reapply(Context context, View v)
Applies all of the actions to the provided view.
Caller beware: this may throw
public
void
setChronometer(int viewId, long base, String format, boolean running)
public
void
setImageViewResource(int viewId, int srcId)
Equivalent to calling ImageView.setImageResource
Parameters
viewId
| The id of the view whose drawable should change |
srcId
| The new resource id for the drawable
|
public
void
setImageViewUri(int viewId, Uri uri)
Equivalent to calling ImageView.setImageURI
Parameters
viewId
| The id of the view whose drawable should change |
uri
| The Uri for the image
|
public
void
setProgressBar(int viewId, int max, int progress, boolean indeterminate)
public
void
setTextViewText(int viewId, CharSequence text)
Equivalent to calling TextView.setText
Parameters
viewId
| The id of the view whose text should change |
text
| The new text for the view
|
public
void
setViewVisibility(int viewId, int visibility)
Equivalent to calling View.setVisibility
Parameters
viewId
| The id of the view whose visibility should change |
visibility
| The new visibility for the view
|
public
void
writeToParcel(Parcel dest, int flags)
Flatten this object in to a Parcel.