Reference:Android.widget.RemoteViews
From Triled Wiki
android.widget
public class android.widget.RemoteViews
| java.lang.Object | ||
| android.widget.RemoteViews | Parcelable | |
[edit] Nested Classes
| RemoteViews.ActionException | Exception to send when something goes wrong executing an action |
[edit] Summary
[edit] Constants
| Value | ||||
|---|---|---|---|---|
| Creator | CREATOR | Parcelable.Creator that instantiates RemoteViews objects |
[edit] Public Constructors
| RemoteViews (String packageName, int layoutId) | |||||
| Create a new RemoteViews object that will display the views contained in the specified layout file. | |||||
| RemoteViews (Parcel parcel) | |||||
| Reads a RemoteViews object from a parcel. | |||||
[edit] Public Methods
| View | apply (Context context, ViewGroup parent) | ||||
| Inflates the view hierarchy represented by this object an applies all of the actions. | |||||
| void | setChronometer (int viewId, long base, String format, boolean running) | ||||
| Equivalent to calling Chronometer.setBase, Chronometer.setFormat, and Chronometer.start() or Chronometer.stop(). | |||||
| void | setImageViewResource (int viewId, int srcId) | ||||
| Equivalent to calling ImageView.setImageResource | |||||
| void | setImageViewUri (int viewId, Uri uri) | ||||
| Equivalent to calling ImageView.setImageURI | |||||
| void | setTextViewText (int viewId, CharSequence text) | ||||
| Equivalent to calling TextView.setText | |||||
| void | setViewVisibility (int viewId, int visibility) | ||||
| Equivalent to calling View.setVisibility | |||||
| void | writeToParcel (Parcel dest) | ||||
[edit] Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait[edit] Methods inherited from interface android.os.Parcelable
[edit] Details
[edit] Constants
[edit] public static final Creator CREATOR
Parcelable.Creator that instantiates RemoteViews objects
[edit] Public Constructors
[edit] 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 |
[edit] public RemoteViews(Parcel parcel)
Reads a RemoteViews object from a parcel.
[edit] Public Methods
[edit] public View apply(Context context, ViewGroup parent)
Inflates the view hierarchy represented by this object an 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
[edit] public void setChronometer(int viewId, long base, String format, boolean running)
Equivalent to calling Chronometer.setBase, Chronometer.setFormat, and Chronometer.start() or Chronometer.stop().
Parameters
| viewId | The id of the view whose text should change |
|---|---|
| base | The time at which the timer would have read 0:00. This time should be based off of SystemClock.elapsedRealtime(). |
| format | The Chronometer format string, or null to simply display the timer value. |
| running | True if you want the clock to be running, false if not. |
[edit] 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 |
[edit] 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 |
[edit] 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 |
[edit] 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 |
[edit] public void writeToParcel(Parcel dest)
[edit] References
- Original documentation page for Android SDK build m5-rc15e - 14 apr 2008 17:27
