I made a simple android application that moves from one activity to another activity on length 5 edit text input. But I getting the exception. I have attached two java files(MainActicity and Another), mainfest file and logcat output. some one please help me.
Thanks in advance.
Download link:: http://www.4shared.com/folder/gyDYjAYC/AndroidApp.html
logcat is:
08-10 16:15:47.289: D/AndroidRuntime(4043): Shutting down VM
08-10 16:15:47.296: W/dalvikvm(4043): threadid=1: thread exiting with uncaught exception (group=0x40018578)
08-10 16:15:47.296: E/AndroidRuntime(4043): FATAL EXCEPTION: main
08-10 16:15:47.296: E/AndroidRuntime(4043): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.practice/com.example.practice.Another}: java.lang.NullPointerException
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.os.Handler.dispatchMessage(Handler.java:99)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.os.Looper.loop(Looper.java:130)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.ActivityThread.main(ActivityThread.java:3687)
08-10 16:15:47.296: E/AndroidRuntime(4043): at java.lang.reflect.Method.invokeNative(Native Method)
08-10 16:15:47.296: E/AndroidRuntime(4043): at java.lang.reflect.Method.invoke(Method.java:507)
08-10 16:15:47.296: E/AndroidRuntime(4043): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
08-10 16:15:47.296: E/AndroidRuntime(4043): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625)
08-10 16:15:47.296: E/AndroidRuntime(4043): at dalvik.system.NativeStart.main(Native Method)
08-10 16:15:47.296: E/AndroidRuntime(4043): Caused by: java.lang.NullPointerException
08-10 16:15:47.296: E/AndroidRuntime(4043): at com.example.practice.Another.onCreate(Another.java:18)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
08-10 16:15:47.296: E/AndroidRuntime(4043): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
08-10 16:15:47.296: E/AndroidRuntime(4043):
... 11 more
In your
Anotherclass:In this code
cis null, since android won’t set any extra to the launcherIntent.