Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8919335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:59:39+00:00 2026-06-15T05:59:39+00:00

I try to open the same class as the one I am currently in

  • 0

I try to open the same class as the one I am currently in with different parameters when pressing a button. I do this with:

Intent j = new Intent("com.test.com.ANSWER");
            id = calculateId(0);
            j.putExtra("id", Long.toString(id));
            startActivityForResult(j, 0);

But I get a nullpointer exception.. Is there some rule that you cannot open the same activity within itself?

Error:

12-01 01:29:10.314: E/AndroidRuntime(2194): FATAL EXCEPTION: main
12-01 01:29:10.314: E/AndroidRuntime(2194): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test/com.test.Answer}: java.lang.NullPointerException
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.os.Looper.loop(Looper.java:130)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.ActivityThread.main(ActivityThread.java:3683)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at java.lang.reflect.Method.invokeNative(Native Method)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at java.lang.reflect.Method.invoke(Method.java:507)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:861)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:619)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at dalvik.system.NativeStart.main(Native Method)
12-01 01:29:10.314: E/AndroidRuntime(2194): Caused by: java.lang.NullPointerException
12-01 01:29:10.314: E/AndroidRuntime(2194):     at com.test.Answer.onCreate(Answer.java:86)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
12-01 01:29:10.314: E/AndroidRuntime(2194):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:59:42+00:00Added an answer on June 15, 2026 at 5:59 am

    I think your id isn’t getting initialized. You are trying to initialize it with a function that uses the id so it never has a value. If this isn’t it then you are using the same variable name in different places which isn’t very good practice usually

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try open and play .wav files with NAudio lib. private OpenFileDialog openFileDialog =
I try to open a finder window which works fine but every time I
when I try to open a file for reading in my console application i
When I try to open a file in write mode with the following code:
When I try to open the following video: http://streaming1.hss-win.rpi.edu/ondemand/cogsci/issues_in_cs/issues_in_cogsci_02_04_2009.asf I can get it but
When I try to open a project's CodeAnalysis page I get the error An
Whenever I try to open a file with ifstream, it compiles fine, but will
Whenever I try to open .pyc or .pyo files, I always get an error
XCode 4.31 crash when i try to open my project. I could open any
I'm getting the following error when I try to open up a connection with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.