A Quick Note on Remote Views

The class RemoteViews can’t be constructed by passing explicit view objects. Nor can view objects be directly added to RemoteViews. Instead, you construct a RemoteViews object by passing a layout file to its constructor. As of 4.0, only the following views are allowed to be in these layout files

  • FrameLayout
  • LinearLayout
  • RelativeLayout
  • AnalogClock
  • Button
  • Chronometer
  • ImageButton
  • ProgressBar
  • ListView
  • GridView
  • StackView
  • TextView
  • DateTimeView
  • ImageView
  • AdapterViewFlipper
  • ViewFlipper

More remote views may be added in future releases. The key to finding out which of the current UI objects are enabled for RemoteViews is the fact that these classes are annotated with an interface called RemoteViews.RemoteView.

Armed with ...

Get Pro Android 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.