Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 17. AppWidgets > Displaying an AppWidget with RemoteViews

17.6. Displaying an AppWidget with RemoteViews

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.

17.6.1. Working with RemoteViews

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.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial