ClassCastException: android.widget.EditText
<p>I always get the error:</p>

<pre><code>10-03 09:55:44.517: ERROR/AndroidRuntime(819): Caused by: java.lang.ClassCastException: android.widget.EditText
</code></pre>

<p>In my code I don't have the word <code>EditText</code> so why does that error occur?</p>

<p>The MultiAutoCompleteTextView was a EditText before. Please help</p>

<p>Code:</p>

<pre><code>public class AddPizza extends Activity {
    private ImageView iv;
    private MultiAutoCompleteTextView name;
    private RatingBar rating;
    private SQLiteDatabase myDB;
    final String MY_DB_NAME = "PizzaCounter";
    final String MY_DB_TABLE = "Pizza";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.addpizza);

        iv = (ImageView) findViewById(R.id.imageViewPizza);
        name = (MultiAutoCompleteTextView) findViewById(R.id.multiAutoCompleteTextView1);
        rating = (RatingBar) findViewById(R.id.ratingBar1);
        Button bt = (Button) findViewById(R.id.bt_addform);

        iv.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                startActivityForResult(new Intent(MediaStore.ACTION_IMAGE_CAPTURE),1337);
            }
        });

        bt.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                addData();
                finish();
            }


        });

         addAutoSuggest();
    }
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (requestCode == 1337) {
            iv.setImageBitmap((Bitmap) data.getExtras().get("data"));
        }
    }
    private void addData() {
        myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
        //myDB.execSQL("DROP TABLE " + MY_DB_TABLE);
        myDB.execSQL("CREATE TABLE IF NOT EXISTS " + MY_DB_TABLE
                    + " (_id integer primary key autoincrement, name varchar(100), rate integer(1), eattime varchar(100),image BLOB)"
                    +";");
        if(!name.getText().equals("") &amp;&amp; rating.getRating()!=0.0)
        {
            Log.e("XXX", "Enter_Insert");
            Calendar cal = Calendar.getInstance(); 
            DateFormat formatter = new SimpleDateFormat(); 
            ByteArrayOutputStream out = new ByteArrayOutputStream();
            Bitmap bt = ((BitmapDrawable)iv.getDrawable()).getBitmap();
            bt.compress(Bitmap.CompressFormat.PNG, 100, out);
            ContentValues cv = new ContentValues();
            cv.put("image", out.toByteArray());            
            cv.put("name", name.getText().toString());
            cv.put("eattime", formatter.format(cal.getTime()));
            cv.put("rate", rating.getRating());
            myDB.insert(MY_DB_TABLE, null, cv);

            //myDB.execSQL("INSERT INTO "+ MY_DB_TABLE + "(name,rate,eattime,image) VALUES +" +  + ", " ++ " , datetime('now', 'localtime'), " );
        }

    }

    void addAutoSuggest ()

    {
         myDB = this.openOrCreateDatabase(MY_DB_NAME, MODE_PRIVATE, null);
         ArrayList&lt;String&gt; list = new ArrayList&lt;String&gt;();
         Cursor cursor = this.myDB.query(MY_DB_TABLE, new String[] {"name"},null,null,null,null,null,null);
          if (cursor.moveToFirst()) {
             do {
                list.add(cursor.getString(0)); 
                } 
             while (cursor.moveToNext());
          }
          if (cursor != null &amp;&amp; !cursor.isClosed()) {
             cursor.close();
          }
        name.setAdapter( new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_dropdown_item_1line, list));
    }


}
</code></pre>

<p>Layout:</p>

<pre><code>&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:orientation="vertical"&gt;
    &lt;TextView android:text="Name" android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
    &lt;MultiAutoCompleteTextView android:id="@+id/multiAutoCompleteTextView1" android:layout_height="wrap_content" android:text="MultiAutoCompleteTextView" android:layout_width="fill_parent"&gt;&lt;/MultiAutoCompleteTextView&gt;

    &lt;TextView android:text="Bewertung" android:id="@+id/textView2" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
    &lt;RatingBar android:id="@+id/ratingBar1" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/RatingBar&gt;
    &lt;TextView android:text="Foto hinzufügen" android:id="@+id/textView3" android:layout_width="wrap_content" android:layout_height="wrap_content"&gt;&lt;/TextView&gt;
    &lt;ImageView android:layout_height="wrap_content" android:src="@drawable/icon" android:layout_width="wrap_content" android:id="@+id/imageViewPizza"&gt;&lt;/ImageView&gt;
    &lt;RelativeLayout android:id="@+id/relativeLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt;
        &lt;Button android:text="hinzufügen" android:layout_height="wrap_content" android:id="@+id/bt_addform" android:layout_alignParentBottom="true" android:layout_width="fill_parent"&gt;&lt;/Button&gt;
    &lt;/RelativeLayout&gt;
&lt;/LinearLayout&gt;
</code></pre>
