I'm reading a book "Android Application Development for dummies" and i can not understand that line of code can you explain it to me,please
RemoteViews updateViews=new RemoteViews(context.getPackageName(),R.layout.widget);
And here is how author explain it :
Here I am building a RemoteView object with the current package
name as well as the layout that will be returned from this method.
The layout, R.layout.widget
, is shown in Listing 7-3.
But how to understand this "will be returned from this method"?
This is specifying an XML layout file that is part of your app. Generally, RemoteViews are for widgets - so this is saying that the creation of this remote view will return the XML layout specified as R.layout.x, that you can then modify the contents of.