Modes/States in Android
<p>I am developing a game for android and I am trying to add the different game modes/states to it like in the lunar lander example. I am having problems with it because my activity starts from a title screen with a a few buttons and one you press to play the game. When you press the play button the app crashes. Is their anyway I can add the different modes/states to my game properly.</p>

<pre><code>EDIT:

07-18 03:40:24.210: ERROR/AndroidRuntime(224): Uncaught handler: thread main exiting due to uncaught exception
07-18 03:40:24.391: ERROR/AndroidRuntime(224): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.hitmanassault/com.android.hitmanassault.Hitman}: java.lang.ClassCastException: android.widget.TextView
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2496)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2512)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.access$2200(ActivityThread.java:119)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1863)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.os.Handler.dispatchMessage(Handler.java:99)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.os.Looper.loop(Looper.java:123)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.main(ActivityThread.java:4363)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at java.lang.reflect.Method.invokeNative(Native Method)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at java.lang.reflect.Method.invoke(Method.java:521)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at dalvik.system.NativeStart.main(Native Method)
07-18 03:40:24.391: ERROR/AndroidRuntime(224): Caused by: java.lang.ClassCastException: android.widget.TextView
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at com.android.hitmanassault.Hitman.onCreate(Hitman.java:48)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2459)
07-18 03:40:24.391: ERROR/AndroidRuntime(224):     ... 11 more
</code></pre>
