android - ClassCastException - an ADT bug? -


well might seem silly.. driving me insane. have autocompletetextview looks like:

     <autocompletetextview     android:id="@+id/etactionsearch"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:layout_alignparentleft="true"     android:layout_centervertical="true"     android:layout_marginleft="5dp"     android:layout_toleftof="@+id/linearlayout2"     android:drawableleft="@android:drawable/ic_menu_search"     android:drawablepadding="7dp"     android:ems="10"     android:focusable="true"     android:focusableintouchmode="true"     android:hint="start typing name"     android:inputtype="textfilter"     android:visibility="gone" /> 

it used edittext while ago, changed xml per hand (to autocompletetextview) without deleting view , creating again. reference in code:

  private autocompletetextview etactionsearch; //class field   etactionsearch = (autocompletetextview) actionbar.getcustomview()             .findviewbyid(r.id.etactionsearch);     etactionsearch.setthreshold(1); 

and issue: on device used test app since created everything's working fine. send project mate of me, runs on device running same android version:

    java.lang.classcastexception: android.widget.edittext cannot cast android.widget.autocompletetextview 

i send him exported .apk, same issue, crash. install same .apk on device, everything's working fine. run code on emulator (1st time running on emulator) - same exception, crash. deleted r.java, gen folder, cleaned project multiple times, issue still remains.... ask: hell going on?

solved suggestion: don't code @ night

changes widgets in layout file should reflected in corresponding files residing in other res/layout-* folders. or, these changes should handled appropriately in code.