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 7071595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:42:25+00:00 2026-05-28T05:42:25+00:00

Edit: the answer is not to call startActivityForResult on the called Activity object, instead

  • 0

Edit: the answer is not to call startActivityForResult on the called Activity object, instead invoke it from the caller’s context.

This is my code, exception on last line:

107 Intent intent = new Intent(CallingActivity.this, CalledActivity.class);
108 CalledActivity calledActivity = new CalledActivity();
109 calledActivity.startActivityForResult(intent, CALLED_ACTIVITY_CODE);

Inside CallingActivity:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);
    Log.i(SR.tag,"req=" + requestCode + " res=" + resultCode); //Never getting here
}

Manifest file snippet:

<activity android:name=".ui.CallingActivity"
          android:label="@string/app_name">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
    </intent-filter>
</activity>
<activity android:name=".ui.CalledActivity"></activity>

Exception:

01-14 11:30:14.850: ERROR/AndroidRuntime(1036): FATAL EXCEPTION: main
01-14 11:30:14.850: ERROR/AndroidRuntime(1036): java.lang.NullPointerException
01-14 11:30:14.850: ERROR/AndroidRuntime(1036):     at android.app.Activity.startActivityForResult(Activity.java:2833)
01-14 11:30:14.850: ERROR/AndroidRuntime(1036):     at com.litvin.app.ui.CallingActivity.onSharedPreferenceChanged(CallingActivity.java:109    )
...

Whenever I move the HOME and LAUNCHER intent filters into .ui.CalledActivity, it works fine. It starts CalledActivity when I press the icon.

I have looked through many similar answers here, but none worked for me.

  • 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-05-28T05:42:26+00:00Added an answer on May 28, 2026 at 5:42 am

    // no need to create any object for that

    CalledActivity calledActivity = new CalledActivity(); //comment this line
    

    //do this

    intent.startActivityForResult(intent, CALLED_ACTIVITY_CODE);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: To answer some questions, this is the revised and still not working code
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
NOTE: THE PROBLEM IS NOT IN THIS CODE, BUT THE ANSWER FOR EXC_BAD_ACCESS is
Is there a way to convert from System.Windows.Forms.HtmlElement to mshtml.IHTMLElemenet3? --edit after answer accepted
Edit: From another question I provided an answer that has links to a lot
Edit: I have solved this by myself. See my answer below I have set
Can I intercept a method call in Objective-C? How? Edit: Mark Powell 's answer
I'm not sure what exactly to call this, but I've been able to reproduce
Edit : See my full answer at the bottom of this question. tl;dr answer
I'll prefix this question with: No, Setting IRONPYTHONPATH is not the answer. Anyway... I

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.