<TableRow>
<TextView android:text="Address:" />
<EditText android:id ="@+id/addr" />
</TableRow>
<TableRow>
<TextView android:text="Type:" />
<RadioGroup android:id="@+id/types"
>
<RadioButton android:id="@+id/take_out"
android:text="Take-Out"
/>
<RadioButton android:id="@+id/sit_down"
android:text="Sit-Down"
/>
<RadioButton android:id="@+id/delivery"
android:text="Delivery"
/>
</RadioGroup>
</TableRow>
<Button android:id="@+id/save"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Save"
/>
</TableLayout>
=============================================================================
I/ActivityManager( 565): Starting activity: Intent
{ action=android.intent.action.MAIN
categories={android.intent.category.LAUNCHER} flags=0x10200000
comp={apt.tutorial/apt.tutorial.LunchList} }
I/ActivityManager( 565): Start proc apt.tutorial for activity
apt.tutorial/.LunchList: pid=687 uid=10019 gids={}
D/AndroidRuntime( 687): Shutting down VM
W/dalvikvm( 687): threadid=3: thread exiting with uncaught exception
(group=0x4000fe70)
E/AndroidRuntime( 687): Uncaught handler: thread main exiting due to
uncaught exception
E/AndroidRuntime( 687): java.lang.RuntimeException: Unable to start
activity ComponentInfo{apt.tutorial/apt.tutorial.LunchList}:
java.lang.ClassCastE
xception: android.widget.RadioGroup
E/AndroidRuntime( 687): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2268)
E/AndroidRuntime( 687): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2284)
E/AndroidRuntime( 687): at android.app.ActivityThread.access
$1800(ActivityThread.java:112)
E/AndroidRuntime( 687): at android.app.ActivityThread
$H.handleMessage(ActivityThread.java:1692)
E/AndroidRuntime( 687): at
android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 687): at android.os.Looper.loop(Looper.java:
123)
E/AndroidRuntime( 687): at
android.app.ActivityThread.main(ActivityThread.java:3948)
E/AndroidRuntime( 687): at
java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 687): at
java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 687): at com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:782)
E/AndroidRuntime( 687): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
E/AndroidRuntime( 687): at
dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 687): Caused by: java.lang.ClassCastException:
android.widget.RadioGroup
E/AndroidRuntime( 687): at
apt.tutorial.LunchList.onCreate(LunchList.java:22)
E/AndroidRuntime( 687): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1123)
E/AndroidRuntime( 687): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2231)
E/AndroidRuntime( 687): ... 11 more
I/Process ( 565): Sending signal. PID: 687 SIG: 3
I/dalvikvm( 687): threadid=7: reacting to signal 3
I/dalvikvm( 687): Wrote stack trace to '/data/anr/traces.txt'
I/ARMAssembler( 565): generated
scanline__00000077:03515104_00000000_00000000 [ 27 ipp] (41 ins) at
[0x201510:0x2015b4] in 589460 ns
I/ARMAssembler( 565): generated
scanline__00000077:03515104_00001001_00000000 [ 64 ipp] (84 ins) at
[0x2015b8:0x201708] in 1274463 ns
I/Process ( 687): Sending signal. PID: 687 SIG: 9
I/ActivityManager( 565): Process apt.tutorial (pid 687) has died.
W/InputManagerService( 565): Window already focused, ignoring focus
gain of: com.android.internal.view.IInputMethodClient$Stub
$Proxy@436c6048
W/KeyCharacterMap( 607): No keyboard for id 0
W/KeyCharacterMap( 607): Using default keymap: /system/usr/keychars/
qwerty.kcm.bin
Did you do a Force Clean (Eclipse) or ant clean (command-line), per
pages 24-25 (in Version 2.0 of the book)?
ClassCastExceptions are frequently triggered by resource IDs getting out
of sync, which the above steps should clear up. Certainly ant clean works.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android Training in NYC: 1-2 May 2010: http://guruloft.com
Thank you so much for your help,
Chris
--
You received this message because you are subscribed to the Google Groups "cw-android" group.
To post to this group, send email to cw-an...@googlegroups.com.
To unsubscribe from this group, send email to cw-android+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/cw-android?hl=en.
Thanks, but I'm actually not using Eclipse. I'm working command line
like Mark is doing in the book.
--
That was added in Android 1.6 or so.
Just delete the bin/ and gen/ directories of your project -- that is all
ant clean really does.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
_Android Programming Tutorials_ Version 2.0 Available!
No, it will crop up from time to time, particularly when you add resources.
--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy
Android Training in NYC: 10-11 April 2010: http://guruloft.com