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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:10:13+00:00 2026-05-17T18:10:13+00:00

ok am having a funny problem here, scenario is like this: Intent i of

  • 0

ok am having a funny problem here, scenario is like this:

Intent i of Activity “B” calls Activity “A” and the method in onCreate() of Activity “A” runs;

intent j of activity “B” calls Activity “A” and puts an “Int” extra which i can use to call a method in Activity “A”

intent x, y and z of TabActivity “C” calls Activity “A” and puts a “String” Extra in other to start a different method in Activity “A”;

problem am having is that, regardless of what i put in the intent of Activity “C”, the method from intent j keeps executing.

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

                          fillData(); // intent i of Activity B

            HandleIntent(getIntent()); // other intents

    }

    public void HandleIntent(Intent intent){
        getIntent();

        if(getIntent().getExtras() != null){
    int priorityrequest = intent.getIntExtra("com.MyApp.PriorityRequestCode" PRIORITY_REQUEST_CODE);

        if(priorityrequest == 1){
            PSData(); //  from intent j of Activity B this keeps executing
        } 
 int homerequest = intent.getIntExtra("com.MyApp.HomeRequestCode", HOME_REQUEST_CODE);
         if(homerequest == 3){
             HomeData(); // doesn't execute keeps executing PSData();
         }
          }
    }

    public void onNewIntent(Intent newIntent){
        HandleIntent(getIntent());
        super.onNewIntent(newIntent);   
    }

From the code, PSData() keeps executing regardless of if i send another intent from another activity with the HOME_REQUEST_CODE. or is it possible to get Intent from a specific class or activity?…

  • 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-17T18:10:14+00:00Added an answer on May 17, 2026 at 6:10 pm

    In
    intent.getIntExtra("com.MyApp.PriorityRequestCode" PRIORITY_REQUEST_CODE); a comma is missing:
    intent.getIntExtra("com.MyApp.PriorityRequestCode", PRIORITY_REQUEST_CODE);

    is the default value of PRIORITY_REQUEST_CODE = 1?

    Since you compare to a specific value and maybe you don’t need a default value, you can try this sintax

    Bundle extras = getIntent().getExtras();
    
    if(extras != null){
        int priorityrequest = extras.getInt("com.MyApp.PriorityRequestCode");
        if(priorityrequest == 1){         
            PSData(); 
        }
        int homerequest = extras.getInt("com.MyApp.HomeRequestCode"); 
        if(homerequest == 3){          
            HomeData();
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a funky problem. Here's my code. I run getJSON() to fetch
I'm having a problem similar to [this question][1] https://stackoverflow.com/questions/1449072/debugging-problem-in-x-code-iphone-development I have created an application,
C#.NET 4.0 I'm having an interesting problem here with reading a custom file archive
I faced a very odd problem It seems very funny looks like some stuffs
I am having a funny situation which I am not sure if it is
Having a hard time with labels on a ggplot2 plot. Here's a similar plot
I found a funny issue with DB2 v9.7 and the SQL LIKE operator. Check
I'm having weird problem with java TimeZone.. Calling TimeZone.getDefault() gives my local time zone,
I'm having a problem which I don't know what to search in google. Basically
I am having a funny with my C++ managed code with visual 2008. 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.