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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T21:12:46+00:00 2026-06-10T21:12:46+00:00

Can anyone kindly list what are the values of requestCode to be passed with

  • 0

Can anyone kindly list what are the values of requestCode to be passed with startActivityForResult() and their purpose? Also, can you explain on the setResult parameters available like RESULT_OK and what else are there? Kindly help.

  • 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-10T21:12:47+00:00Added an answer on June 10, 2026 at 9:12 pm

    When you launch an activity for result with requestCode >= 0, this code will be returned to the First Activity’s onActivityResult() when second activity is finished.You can start multiple Activity for result from your Activity. In each case you get the callback to startActivityForResult() method passing the requestCode. In onActivityResult() we can use the requestCode to find out for which activity we have received the callback. So to differentiate between the callbacks from Activities we use different requestCodes.

    For eg:

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    
        Intent i = new Intent(FirstActivity.this, SecondActivity.class);
        startActivityForResult(i, 1);
        Intent i = new Intent(FirstActivity.this, ThirdActivity.class);
        startActivityForResult(i, 2);
    }
    
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    
     if (requestCode == 1) {
    
      if (resultCode == RESULT_OK) {
      //Get the result from SecondActivity
      }
    
      }
     else  if (requestCode == 2) {
      if (resultCode == RESULT_OK) {
      //Get the result from ThirdActivity
      }
     }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone kindly explain how to send a concatenated WAP PUSH SMS? I can
Can anyone explain to me why this program: for(float i = -1; i <
Can anyone explain why here a = [] ? 1 : 2 a will
Can anyone please tell/suggest me how can i store and retrieve comments multiple/different values
Can anyone kindly tell me which one should I install to develop database applications
Greetings! Can anyone please kindly assist me finding a way around the following: load
Is there such a thing? Can anyone kindly elucidate on this? I have been
Can anyone kindly enlighten me on how to get previous day's date in 'YYYY-MM-DD'
Can anyone kindly tell that can we use Hadoop and any NoSQL database like
As memory is considered to be single dimensional, then can anyone kindly tell (and

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.