Skip to content Skip to sidebar Skip to footer

Why Intent Makes My Application Crashed?

I just want to ask you why using intent makes my system crashed? I've used same codes before and it works, then when I use it again now it won't. What do you think the problem guys

Solution 1:

You need to add Login Activity to your AndroidManifest.xml so that the android operating system can find the Activity that the intent is referencing.

<activity
android:name=".Activities.Login"
android:label="Login" />

Solution 2:

You really need to show us your stacktrace for any useful feedback. I suspect you aren't declaring the Login activity in your AndroidManifest.xml correctly.

LogCat will contain the error stacktrace. Most likely you will see a giant block of red text that will indicate the part we are interested in. Below is an example of one of my stacktraces. Hopefully it helps you find it.

java.lang.RuntimeException: Unable to start activity ComponentInfo{package.name.ThingDetailActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'long com.package.api.model.Thing.getId()' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2325) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387) at android.app.ActivityThread.access$800(ActivityThread.java:151) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1303) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5254) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)


Post a Comment for "Why Intent Makes My Application Crashed?"