Daming will write some high-quality blogs in the future, which should be as thorough as possible, and be able to read from different perspectives. When there are many problems, the technology is actually a window, when you have a lot of windows, it is difficult to solve the problem. So we need to analyze the problem one by one and break down every window. I have seen some help documents translated from Chinese on the Internet, so I also want to try it out and see what my English skills are like? So let's take a look at RemoteViews. RemoteViews uses the layer concept, that is, you add a layout on the parent view, which is actually two layers. The idea of common view layers for games. For example, the dialogue in game characters is actually a layer concept presented to users.
I hope you can correct them more;
1. inheritance relationship:
RemoteViews extends Object implements ParcelableLayoutInflater. Filter
Ii. Category Description:
This class can be displayed in a hierarchical view class in other processes. This hierarchy can be loaded using layout files, and some basic methods are provided to modify the content.
Iii. Internal summary:
When class RemoteViews. ActionException is incorrect, an action is executed to send an exception message.
@ Interface RemoteViews. RemoteView: loading this interface indicates that the View subclass can use the RemoteViews mechanism.
4. fields:
Publicstatic final Creator <RemoteViews> constructor Parcelable. Creator is used to instantiate the RemoteViews class.
5. constructor:
RemoteViews (String packageName, int layoutId); displays RemoteViews by loading the specified layout.
RemoteViews (Parcel parcel); read the RemoteViews object from a parcel.
6. Public methods:
1. public voidaddView (int viewId, RemoteViews nestedView)
Call this addview method to load the specified RemoteViews, which allows users to load RemoteViews through internal methods. In some cases, the created RemoteViews can reclaim the layout, use removeAllViews (int) to clear any existing sub-view views.
Parameters:
ViewId: id of the parent ViewGroup to which the child view is to be added
RemoteViews
2. publicViewapply (Context context, ViewGroup parent)
Use Inflates to load view objects and apply them to all actions.
This method may throw an exception.
Parameters:
Context default context
The parent generates the parent to be filled in the view layer. This method is not appended to the hierarchy. The caller should handle the issue as appropriate.
Returned value: view layer loaded with inflate.
3. public RemoteViewsclone ()
Creates and returns a replica of this object. By default, a (self-called) Shortest copy is returned. It creates a new instance of this class and
Copy Field Values (including class-related values) to the new instance. In contrast, deep copy also Recursively copies internal classes.
Returned value: the replica of this class.
4. public int describeContents ()
Describes special objects in a specific encoding format in Parcelable.
Return Value: return the bitmask of the object type encoded in Parcelable format.
5. public int getLayoutId () to get the layout id
6. publicStringgetPackage () obtains the package of this class.
7. public boolean onLoadClass (Class clazz)
Hook allows the LayoutInflater client to restrict the setting of views, that is, allow loading by inflated.
Parameter: view object used for inflated loading by clazz
Return Value: true: this class is allowed; false indicates no;
8. public void reapply (Context context, View v)
Add all actions to the view object. This method will throw this Caller beware exception;
Parameter: v view of the action to be added. This should be the result of the apply (Context, ViewGroup) Call.
9. public void removeAllViews (int viewId)
And call removeAllViews;
Parameter: the id of the parent ViewGroup of all child views to be removed from viewed
10. public void setBitmap (int viewId, String methodName, Bitmap value)
Provides a method to add Bitmap values for RemoteViews in the view layout.
Parameter: viewId the entire attempt id
MethodName: name of the method to be called
Value to be passed
Note: The methods of other set values are similar, that is, the parameters are different. Let's translate them here today, hoping to help readers a little bit!
Original works, commercial prohibited, reproduced please indicate the source: http://blog.csdn.net/wdaming1986/article/details/7038402