Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android The following classes could not be found - EditText (Change to android.widget.EditText, Fix Build Path, Edit XML)

Tags:

android

class

When trying to view the Graphical Layout view I am getting the following error:

The following classes could not be found - EditText (Change to android.widget.EditText, Fix Build Path, Edit XML)

The app works fine and I can edit the XML without any problems. I just can't load the graphical layout view anymore. In the Main.java file there are no problems or errors importing the EditText widget from the Android library.

I'm using Eclipse Indigo Service Release 2. Got all the recent updates.

I'm also using the latest Android SDK Tools 20.0.1

Here is the source. I've tried the option to Source > Cleanup Document and Format just to make sure the XML was correct.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <Button
        android:id="@+id/button1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentTop="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="63dp"
        android:text="@string/button1" />

    <EditText
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="16dp"
        android:ems="10"
        android:inputType="" >

        <requestFocus />
    </EditText>

</RelativeLayout>

I managed to fix the problem.

I had to change

android:inputType="" to android:inputType="text"

The Graphical Layout view now works again.

like image 383
pioneear Avatar asked Aug 12 '12 17:08

pioneear


1 Answers

this is because if you are using api 4.4W which is recently released for android wear

and Android wear doesnot support edittext

http://developer.android.com/training/building-wearables.html

like image 108
raj Avatar answered Nov 04 '22 03:11

raj