Cannot be cast to android.view.ViewGroup

 java.lang.ClassCastException: com.philips.platform.lumea.firsttreatmentflow.treatmentstart.StartControllerView cannot be cast to android.view.ViewGroup

You can group Views, but you need to use a ViewGroup not a View.
Examples of ViewGroups are LinearLayout (for displaying sub-Views horizontally or vertically), RelativeLayout (for displaying sub-Views using relative positions), FrameLayout, TableLayout etc. Use whichever ViewGroup suits your needs.

To get something working, change the two Views in your XML to FrameLayouts. And also give the Button and TextView layout parameters (e.g. android:layout_width="wrap_content", same for height) - otherwise you'll get another error when you run it.

Comments

Popular posts from this blog

RUN JAVA PROJECT IN ANDROID STUDIO

Gradle DSL method not found: 'compile()'

Reverse string using recursion