Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/view/ViewManager#pubmethods)

# ViewManager

*** ** * ** ***

` public interface ViewManager `   
` `

|---|
| android.view.ViewManager |

Known indirect subclasses [AbsListView](https://developer.android.com/reference/android/widget/AbsListView), [AbsSpinner](https://developer.android.com/reference/android/widget/AbsSpinner), [AbsoluteLayout](https://developer.android.com/reference/android/widget/AbsoluteLayout), [ActionMenuView](https://developer.android.com/reference/android/widget/ActionMenuView), [AdapterView](https://developer.android.com/reference/android/widget/AdapterView)\<T extends [Adapter](https://developer.android.com/reference/android/widget/Adapter)\>, [AdapterViewAnimator](https://developer.android.com/reference/android/widget/AdapterViewAnimator), [AdapterViewFlipper](https://developer.android.com/reference/android/widget/AdapterViewFlipper), [AppWidgetHostView](https://developer.android.com/reference/android/appwidget/AppWidgetHostView), [CalendarView](https://developer.android.com/reference/android/widget/CalendarView), [DatePicker](https://developer.android.com/reference/android/widget/DatePicker), [DialerFilter](https://developer.android.com/reference/android/widget/DialerFilter), [ExpandableListView](https://developer.android.com/reference/android/widget/ExpandableListView), [FragmentBreadCrumbs](https://developer.android.com/reference/android/app/FragmentBreadCrumbs), [FrameLayout](https://developer.android.com/reference/android/widget/FrameLayout), [Gallery](https://developer.android.com/reference/android/widget/Gallery), and 36 others. [AbsListView](https://developer.android.com/reference/android/widget/AbsListView) Base class that can be used to implement virtualized lists of items. [AbsSpinner](https://developer.android.com/reference/android/widget/AbsSpinner) An abstract base class for spinner widgets. [AbsoluteLayout](https://developer.android.com/reference/android/widget/AbsoluteLayout) *This class was deprecated in API level 3. Use `https://developer.android.com/reference/android/widget/FrameLayout`, `https://developer.android.com/reference/android/widget/RelativeLayout` or a custom layout instead.* [ActionMenuView](https://developer.android.com/reference/android/widget/ActionMenuView) ActionMenuView is a presentation of a series of menu options as a View. [AdapterView](https://developer.android.com/reference/android/widget/AdapterView)\<T extends [Adapter](https://developer.android.com/reference/android/widget/Adapter)\> An AdapterView is a view whose children are determined by an `https://developer.android.com/reference/android/widget/Adapter`. [AdapterViewAnimator](https://developer.android.com/reference/android/widget/AdapterViewAnimator) Base class for a `https://developer.android.com/reference/android/widget/AdapterView` that will perform animations when switching between its views. [AdapterViewFlipper](https://developer.android.com/reference/android/widget/AdapterViewFlipper) Simple `https://developer.android.com/reference/android/widget/ViewAnimator` that will animate between two or more views that have been added to it. [AppWidgetHostView](https://developer.android.com/reference/android/appwidget/AppWidgetHostView) Provides the glue to show AppWidget views. [CalendarView](https://developer.android.com/reference/android/widget/CalendarView) This class is a calendar widget for displaying and selecting dates. [DatePicker](https://developer.android.com/reference/android/widget/DatePicker) Provides a widget for selecting a date. [DialerFilter](https://developer.android.com/reference/android/widget/DialerFilter) *This class was deprecated in API level 26. Use a custom view or layout to handle this functionality instead* [ExpandableListView](https://developer.android.com/reference/android/widget/ExpandableListView) A view that shows items in a vertically scrolling two-level list. [FragmentBreadCrumbs](https://developer.android.com/reference/android/app/FragmentBreadCrumbs) *This class was deprecated in API level 21. This widget is no longer supported.* [FrameLayout](https://developer.android.com/reference/android/widget/FrameLayout) FrameLayout is designed to block out an area on the screen to display a single item. [Gallery](https://developer.android.com/reference/android/widget/Gallery) *This class was deprecated in API level 16. This widget is no longer supported. Other horizontally scrolling widgets include `https://developer.android.com/reference/android/widget/HorizontalScrollView` and `https://developer.android.com/reference/androidx/viewpager/widget/ViewPager.html` from the support library.* [GestureOverlayView](https://developer.android.com/reference/android/gesture/GestureOverlayView) A transparent overlay for gesture input that can be placed on top of other widgets or contain other widgets. [GridLayout](https://developer.android.com/reference/android/widget/GridLayout) A layout that places its children in a rectangular *grid*. [GridView](https://developer.android.com/reference/android/widget/GridView) A view that shows items in two-dimensional scrolling grid. [HorizontalScrollView](https://developer.android.com/reference/android/widget/HorizontalScrollView) Layout container for a view hierarchy that can be scrolled by the user, allowing it to be larger than the physical display. [ImageSwitcher](https://developer.android.com/reference/android/widget/ImageSwitcher) `https://developer.android.com/reference/android/widget/ViewSwitcher` that switches between two ImageViews when a new image is set on it. [InlineContentView](https://developer.android.com/reference/android/widget/inline/InlineContentView) This class represents a view that holds opaque content from another app that you can inline in your UI. [LinearLayout](https://developer.android.com/reference/android/widget/LinearLayout) A layout that arranges other views either horizontally in a single column or vertically in a single row. [ListView](https://developer.android.com/reference/android/widget/ListView) Displays a vertically-scrollable collection of views, where each view is positioned immediately below the previous view in the list.
[MediaController](https://developer.android.com/reference/android/widget/MediaController) A view containing controls for a MediaPlayer. [NumberPicker](https://developer.android.com/reference/android/widget/NumberPicker) A widget that enables the user to select a number from a predefined range. [RadioGroup](https://developer.android.com/reference/android/widget/RadioGroup) This class is used to create a multiple-exclusion scope for a set of radio buttons.
[RelativeLayout](https://developer.android.com/reference/android/widget/RelativeLayout) A Layout where the positions of the children can be described in relation to each other or to the parent. [ScrollView](https://developer.android.com/reference/android/widget/ScrollView) A view group that allows the view hierarchy placed within it to be scrolled. [SearchView](https://developer.android.com/reference/android/widget/SearchView) A widget that provides a user interface for the user to enter a search query and submit a request to a search provider. [SlidingDrawer](https://developer.android.com/reference/android/widget/SlidingDrawer) *This class was deprecated in API level 17. This class is not supported anymore. It is recommended you base your own implementation on the source code for the Android Open Source Project if you must use it in your application.* [Spinner](https://developer.android.com/reference/android/widget/Spinner) A view that displays one child at a time and lets the user pick among them. [SplashScreenView](https://developer.android.com/reference/android/window/SplashScreenView) The view which allows an activity to customize its splash screen exit animation.
[StackView](https://developer.android.com/reference/android/widget/StackView) A view that displays its children in a stack and allows users to discretely swipe through the children. [TabHost](https://developer.android.com/reference/android/widget/TabHost) *This class was deprecated in API level 30. new applications should use fragment APIs instead of this class: Use [TabLayout and ViewPager](https://developer.android.com/guide/navigation/navigation-swipe-view) instead.* [TabWidget](https://developer.android.com/reference/android/widget/TabWidget) *This class was deprecated in API level 30. new applications should use fragment APIs instead of this class: Use [TabLayout and ViewPager](https://developer.android.com/guide/navigation/navigation-swipe-view) instead.* [TableLayout](https://developer.android.com/reference/android/widget/TableLayout) A layout that arranges its children into rows and columns.
[TableRow](https://developer.android.com/reference/android/widget/TableRow) A layout that arranges its children horizontally.
[TextSwitcher](https://developer.android.com/reference/android/widget/TextSwitcher) Specialized `https://developer.android.com/reference/android/widget/ViewSwitcher` that contains only children of type `https://developer.android.com/reference/android/widget/TextView`. [TimePicker](https://developer.android.com/reference/android/widget/TimePicker) A widget for selecting the time of day, in either 24-hour or AM/PM mode. [Toolbar](https://developer.android.com/reference/android/widget/Toolbar) A standard toolbar for use within application content. [TvAdView](https://developer.android.com/reference/android/media/tv/ad/TvAdView) Displays contents of TV advertisement services. [TvInteractiveAppView](https://developer.android.com/reference/android/media/tv/interactive/TvInteractiveAppView) Displays contents of interactive TV applications. [TvView](https://developer.android.com/reference/android/media/tv/TvView) Displays TV contents. [TwoLineListItem](https://developer.android.com/reference/android/widget/TwoLineListItem) *This class was deprecated in API level 17. This class can be implemented easily by apps using a `https://developer.android.com/reference/android/widget/RelativeLayout` or a `https://developer.android.com/reference/android/widget/LinearLayout`.* [ViewAnimator](https://developer.android.com/reference/android/widget/ViewAnimator) Base class for a `https://developer.android.com/reference/android/widget/FrameLayout` container that will perform animations when switching between its views. [ViewFlipper](https://developer.android.com/reference/android/widget/ViewFlipper) Simple `https://developer.android.com/reference/android/widget/ViewAnimator` that will animate between two or more views that have been added to it. [ViewGroup](https://developer.android.com/reference/android/view/ViewGroup) A `ViewGroup` is a special view that can contain other views (called children.) The view group is the base class for layouts and views containers.
[ViewSwitcher](https://developer.android.com/reference/android/widget/ViewSwitcher) `https://developer.android.com/reference/android/widget/ViewAnimator` that switches between two views, and has a factory from which these views are created. [WebView](https://developer.android.com/reference/android/webkit/WebView) A View that displays web pages. [WindowManager](https://developer.android.com/reference/android/view/WindowManager) The interface that apps use to talk to the window manager. [ZoomControls](https://developer.android.com/reference/android/widget/ZoomControls) *This class was deprecated in API level 29. This functionality and UI is better handled with custom views and layouts rather than a dedicated zoom-control widget*   

*** ** * ** ***

Interface to let you add and remove child views to an Activity. To get an instance of this class, call `https://developer.android.com/reference/android/content/Context#getSystemService(java.lang.String)`.

## Summary

| ### Public methods ||
|---|---|
| ` abstract void` | ` https://developer.android.com/reference/android/view/ViewManager#addView(android.view.View,%20android.view.ViewGroup.LayoutParams)(https://developer.android.com/reference/android/view/View view, https://developer.android.com/reference/android/view/ViewGroup.LayoutParams params) ` Assign the passed LayoutParams to the passed View and add the view to the window. |
| ` abstract void` | ` https://developer.android.com/reference/android/view/ViewManager#removeView(android.view.View)(https://developer.android.com/reference/android/view/View view) ` |
| ` abstract void` | ` https://developer.android.com/reference/android/view/ViewManager#updateViewLayout(android.view.View,%20android.view.ViewGroup.LayoutParams)(https://developer.android.com/reference/android/view/View view, https://developer.android.com/reference/android/view/ViewGroup.LayoutParams params) ` |

## Public methods

### addView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void addView (View view, 
                ViewGroup.LayoutParams params)
```

Assign the passed LayoutParams to the passed View and add the view to the window.

Throws `https://developer.android.com/reference/android/view/WindowManager.BadTokenException` for certain programming errors, such as adding a second view to a window without removing the first view.

Throws `https://developer.android.com/reference/android/view/WindowManager.InvalidDisplayException` if the window is on a secondary `https://developer.android.com/reference/android/view/Display` and the specified display can't be found (see `https://developer.android.com/reference/android/app/Presentation`).

<br />

| Parameters ||
|---|---|
| `view` | `View`: The view to be added to this window. <br /> |
| `params` | `ViewGroup.LayoutParams`: The LayoutParams to assign to view. <br /> |

### removeView

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void removeView (View view)
```

<br />

<br />

| Parameters ||
|---|---|
| `view` | `View` <br /> |

### updateViewLayout

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract void updateViewLayout (View view, 
                ViewGroup.LayoutParams params)
```

<br />

<br />

| Parameters ||
|---|---|
| `view` | `View` <br /> |
| `params` | `ViewGroup.LayoutParams` <br /> |