Hi all,
I was updating the ui to one of my apps, and encountered a problem setting
the typeface of the button. According to the online docs, calling
setTypeface() on a button should work. However, I get the following error:
java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.raghavsood.gravity/com.raghavsood.gravity.Forceometer}:
java.lang.ClassCastException: android.widget.TextView cannot be cast to
android.widget.Button
01-08 14:55:41.757: E/ACRA(15317): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1956)
01-08 14:55:41.757: E/ACRA(15317): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981)
01-08 14:55:41.757: E/ACRA(15317): at
android.app.ActivityThread.access$600(ActivityThread.java:123)
01-08 14:55:41.757: E/ACRA(15317): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147)
01-08 14:55:41.757: E/ACRA(15317): at
android.os.Handler.dispatchMessage(Handler.java:99)
01-08 14:55:41.757: E/ACRA(15317): at
android.os.Looper.loop(Looper.java:137)
01-08 14:55:41.757: E/ACRA(15317): at
android.app.ActivityThread.main(ActivityThread.java:4424)
01-08 14:55:41.757: E/ACRA(15317): at
java.lang.reflect.Method.invokeNative(Native Method)
01-08 14:55:41.757: E/ACRA(15317): at
java.lang.reflect.Method.invoke(Method.java:511)
01-08 14:55:41.757: E/ACRA(15317): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassCastException: android.widget.TextView
cannot be cast to android.widget.Button
at com.raghavsood.gravity.Forceometer.onCreate(Forceometer.java:87)
at android.app.Activity.performCreate(Activity.java:4465)
at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1920)
... 11 more
--
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder
--
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