06-25 07:37:52.745: ERROR/AndroidRuntime(1722): Uncaught handler: thread
main exiting due to uncaught exception
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): java.lang.RuntimeException:
Unable to start activity
ComponentInfo{goodteamstudio.rdc/goodteamstudio.rdc.MainMenu}:
java.lang.NullPointerException
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.ActivityThread.access$1800(ActivityThread.java:112)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.os.Handler.dispatchMessage(Handler.java:99)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.os.Looper.loop(Looper.java:123)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.ActivityThread.main(ActivityThread.java:3948)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
java.lang.reflect.Method.invokeNative(Native Method)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
java.lang.reflect.Method.invoke(Method.java:521)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
dalvik.system.NativeStart.main(Native Method)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): Caused by:
java.lang.NullPointerException
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
goodteamstudio.rdc.MainMenu.onCreate(MainMenu.java:314)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)
06-25 07:37:52.774: ERROR/AndroidRuntime(1722): ... 11 more
===============================
XML
<FrameLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res/goodteamstudio.rdc"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<goodteamstudio.game.CMainRun
android:id="@+id/mainmenu_id"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
=========================
public class CMainRun extends View
{
public CMainRun(Context contexts,AttributeSet attrs) {
super(contexts);
context = contexts;
……
}
=======================
setContentView(R.layout.main);
gamerun = (CMainRun)findViewById(R.id.mainmenu_id);
==========================
gamerun = null ????????????
why??
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---