Android misinterprets layout file -
i have main view has listview.
i modified another activity's layout, , application fails start.
the error:
java.lang.classcastexception: android.widget.button cannot cast android.widget.listview
i have xml:
<listview android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#0000" android:id="@+id/list" > another part of same layout file:
<button android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/btnlogin" android:text="@string/okay"/> when use this, shows following:
view v= findviewbyid(r.id.list); ((button)v)).gettext(); //value: "ok", how? list, not button, yet works listview listview=(listview) v; //this error in r.java can find 1 item named list. cleared cache.
so problem is: list has id of list yet android resolves button (which has different id).
can tell me, going on?
i have restarted computer, deleted every non-essential directory, cleared cache, sent quick prayer bill gates, , works. great architecture :)
Comments
Post a Comment