Search code examples
javaandroidillegal-characters

Illegal character U+200B android


i'll Follow below links but didn't help for me :

Whenever i add below code :

// get our folding cell
        final FoldingCell fc = (FoldingCell) findViewById(R.id.folding_cell);
​
        // attach click listener to folding cell
        fc.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                fc.toggle(false);
            }
        });

This Error Comes : Illegal character U+200B

Error is not show on Logcat or massage it's show in MainActivity.class at the below findviewById

activity_main.xml

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.foldingcell.MainActivity">

    <com.ramotion.foldingcell.FoldingCell
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/folding_cell"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:clipChildren="false"
        android:clipToPadding="false"
        >
        ​
    </com.ramotion.foldingcell.FoldingCell>

</LinearLayout>

I copy code from hear: https://android-arsenal.com/details/1/3426


Solution

  • There is an invisible character on the third line. Delete the line manually and add it again using the keyboard.

    Try replacing your code with this one:

    // get our folding cell
        final FoldingCell fc = (FoldingCell) findViewById(R.id.folding_cell);
    
        // attach click listener to folding cell
        fc.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                fc.toggle(false);
            }
        });