Try cleaning your project (Project > Clean from the Eclipse main menu, or ant clean from the command line). Typically, I find that these ClassCastExceptions are because the widget IDs are out of sync between the resources in the APK file and your already-compiled .class files. Cleaning the project forces the .class files to be rebuilt.
On Sat, Aug 20, 2011 at 12:16 PM, Spica <[email protected]> wrote: > I removed EditText from my layout and after that i started getting > "Force close" error. My app is not starting at all. Here is the trace > i captured with logcat; > > ===================================================== > E/AndroidRuntime( 1335): FATAL EXCEPTION: main > E/AndroidRuntime( 1335): java.lang.RuntimeException: Unable to start > activity Co > mponentInfo{com.myApp/com.myApp.DashBoard}: > java.lang.ClassCastException: android.widget.EditText > E/AndroidRuntime( 1335): at > android.app.ActivityThread.performLaunchActiv > ity(ActivityThread.java:2781) > E/AndroidRuntime( 1335): at > android.app.ActivityThread.handleLaunchActivi > ty(ActivityThread.java:2797) > E/AndroidRuntime( 1335): at android.app.ActivityThread.access > $2300(Activi > tyThread.java:135) > E/AndroidRuntime( 1335): at android.app.ActivityThread > $H.handleMessage(Ac > tivityThread.java:2132) > E/AndroidRuntime( 1335): at > android.os.Handler.dispatchMessage(Handler.ja > va:99) > E/AndroidRuntime( 1335): at android.os.Looper.loop(Looper.java: > 143) > E/AndroidRuntime( 1335): at > android.app.ActivityThread.main(ActivityThrea > d.java:4914) > E/AndroidRuntime( 1335): at > java.lang.reflect.Method.invokeNative(Native > Method) > E/AndroidRuntime( 1335): at > java.lang.reflect.Method.invoke(Method.java:5 > 21) > E/AndroidRuntime( 1335): at com.android.internal.os.ZygoteInit > $MethodAndA > rgsCaller.run(ZygoteInit.java:858) > E/AndroidRuntime( 1335): at > com.android.internal.os.ZygoteInit.main(Zygot > eInit.java:616) > E/AndroidRuntime( 1335): at > dalvik.system.NativeStart.main(Native Method) > > E/AndroidRuntime( 1335): Caused by: java.lang.ClassCastException: > android.widget > .EditText > E/AndroidRuntime( 1335): at > com.myApp.DashBoard.onCreate(DashBoard.java > :70) > E/AndroidRuntime( 1335): at > android.app.Instrumentation.callActivityOnCre > ate(Instrumentation.java:1065) > E/AndroidRuntime( 1335): at > android.app.ActivityThread.performLaunchActiv > ity(ActivityThread.java:2745) > ============================================ > > I am not using the removed EditText in the code even then it is > throwing this error... > > -- > You received this message because you are subscribed to the Google > Groups "Android Developers" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/android-developers?hl=en > -- Mark Murphy (a Commons Guy) http://commonsware.com | http://github.com/commonsguy http://commonsware.com/blog | http://twitter.com/commonsguy _The Busy Coder's Guide to Android Development_ Version 3.6 Available! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

