Android: Defining layout_behaviour path-ThrowExceptions

Exception or error:

I’m currently working on a custom behaviour for my Button in a Coordinator Layout and I’d like to set it via xml using “app:layout_behavior” field. Unfortunately I’ve encountered a problem with setting a path to it. Path to my class is as follows: com.example.robert.testapp.ButtonSnackbarBehaviour
but when I set it up like this:

app:layout_behavior="com.example.robert.testapp.ButtonSnackbarBehaviour"

it doesn’t work (throws

08-13 12:25:21.815 5527-5548/com.example.robert.testapp E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
glUtilsParamSize: unknow param 0x000082da
). Probably is just some rookie mistake, I can’t see what’s wrong though.

Edit

Here’s my XML file

<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/EntryScreenCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@color/colorWhite">
<Button
    android:id="@+id/EntryScreenAccelerometerButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Accelerometer screen"
    android:layout_gravity="bottom|end"
    app:layout_behaviour="com.example.robert.testapp.ButtonSnackbarBehaviour"
    />
<Button
    android:id="@+id/EntryScreenButtonToImages"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Make Fragment"
    android:layout_gravity="bottom|start"
    app:layout_behavior="com.example.robert.testapp.ButtonSnackbarBehaviour"
    />
<android.support.design.widget.FloatingActionButton
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"/>
<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent">



<Button
    android:id="@+id/EntryScreenButtonToJSONLoader"
    app:layout_constraintRight_toRightOf="parent"
    app:layout_constraintLeft_toRightOf="@id/EntryScreenButtonToNoXmlFragment"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    android:text="Load JSON"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" />
<Button
    android:id="@+id/EntryScreenButtonToNoXmlFragment"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/entry_screen_to_no_xml_button"
    app:layout_constraintTop_toTopOf="parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintRight_toLeftOf="@id/EntryScreenButtonToJSONLoader"/>
<Button
    android:id="@+id/EntryScreenButtonInternetCheck"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/entry_screen_internet_check_button"
    app:layout_constraintLeft_toLeftOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    />
</android.support.constraint.ConstraintLayout>

How to solve:

Apparently there was a typo in first color(‘colour’ instread of ‘color’). Problem solved, thank you for participation

Leave a Reply

Your email address will not be published. Required fields are marked *