I have a class that extends View (MyView extends View)
In Activity I have next:
View view = (View)findViewById(R.id.relative_layout_view);
//here I have error because of cast
MyView myView = view;
Why its asked me to add cast ?
P.S: I added cast and app is crashes.
Use this way
Just add in xml like
and after that use in activity as given below