Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
An AppWidget runs in the process space of another application, typically the home screen. Running in the space of another application has an impact on what can and can’t be accomplished when interacting with UI elements. This section demonstrates how an AppWidget’s user interface is managed through the use of the RemoteViews class.
The RemoteViews class is used to permit a View to be displayed and managed from a separate process. Unlike a traditional ViewGroup layout, which may be readily managed via direct methods, the access to the view hierarchy inflated under the RemoteViews class is limited and rigid. For example, in a typical Activity the code can inflate a layout by simply referencing it as R.layout.main and passing it to the method setContentView.AppWidgets require more effort than this.