ki0
ki0

Reputation: 377

Problems with Gallery Activity

Ive follow the tutoria about how to make activity Gallery on [android-developer][1]

[1]: http://developer.android.com/guide/tutorials/views/hello-gallery.html but i got the next error:

    02-12 17:54:06.221: ERROR/AndroidRuntime(1330): Uncaught handler: thread main exiting due to uncaught exception
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.addsensor.CameraMap/com.addsensor.CameraMap.GalleryCamera}: java.lang.NullPointerException
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2268)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2284)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.access$1800(ActivityThread.java:112)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1692)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.os.Handler.dispatchMessage(Handler.java:99)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.os.Looper.loop(Looper.java:123)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.ActivityThread.main(ActivityThread.java:3948)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at java.lang.reflect.Method.invokeNative(Native Method)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at java.lang.reflect.Method.invoke(Method.java:521)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:782)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:540)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at dalvik.system.NativeStart.main(Native Method)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330): Caused by: java.lang.NullPointerException
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at com.addsensor.CameraMap.GalleryCamera.onCreate(GalleryCamera.java:20)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
    02-12 17:54:06.301: ERROR/AndroidRuntime(1330):     at 

android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2231)

I have also change one thing which someone comment here, on [stackoverflow][1]

[1]: Android Hello, Gallery tutorial -- "R.styleable cannot be resolved" but i am still getting the error. Its a simple activity and i dont know how to follow. Anyone knows?¿ or how to fix it?¿

thanks

Upvotes: 0

Views: 690

Answers (1)

Peter Knego
Peter Knego

Reputation: 80330

You are trying to use a reference to null (e.g. variable uninitialized, etc..) in CameraMap.GalleryCamera,onCreate() method, line 20.

Please post code for this method (and indicate line number 20).

Upvotes: 1

Related Questions