Convert component to View

Hi,
In my extension, one input im asking for is component, and i want to use it as a view, so is there any chance of converting the component into view or getting its view

Get the view of an AndroidViewComponent:
component.getView();

3 Likes

View view = arrangement.getView();
[javac] ^
[javac] symbol: method getView()
[javac] location: variable arrangement of type Component

Try
(View)arrangement.getView();

1 Like

: error: cannot find symbol
[javac] View view = (View)arrangement.getView();
[javac] ^
[javac] symbol: method getView()
[javac] location: variable arrangement of type Component
[javac] Note: Some input files use or override a deprecated API.

The getView() method is defined in the AndroidViewComponent class, therefore, your variable should be with the type AndroidViewComponent.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.