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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T19:18:49+00:00 2026-06-01T19:18:49+00:00

i want to start activityB from activityA and return string from activityB then resume

  • 0

i want to start activityB from activityA and return string from activityB then resume activityA is it possible?
i refer Android: Capturing the return of an 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-06-01T19:18:51+00:00Added an answer on June 1, 2026 at 7:18 pm

    You can use startActivityForResult() method if you need to pass data back from an activity.
    E.x: return data from Activity B

    Activity A:

    Step1:Call StartActivityForResult() method

    Intent i = new Intent(A.this,B.class);
    // use startActivityForResult(Intent,request_code)  method()
    //with request_code is used to identify.
    starActivityForResult(i,1)
    

    Step2:
    You must implements onActivityResult(int requestCode,int resultCode,Intent data) method

    //check requestCode and resultCode    
    if(requestCode==1)
    {
    
      if(resultCode==RESULT_OK)
    
      {
        //get Data
        String temp =  data.getData().toString();
       }  
    
    
    }
    

    Activity B:

     //set Data return Activity B at anywhere you want
     Intent data = new Intent()
     data.setData("String_Test");
    
     setResult(RESULT_OK,data)
     //close the activity
     finish();
    

    Note: instead of using setData method(), you also able to use putExtras(Bunble object) to send data.

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

Sidebar

Related Questions

I want to start an activity when the service is ran for the first
I want to start a number of subprocesses in my Python script and then
I want to start nutch from Java. How can I start cygwin from a
I've making an app and I want to launch a new activity from a
I have service with thread, From activity I am calling start service(from Activity::onDestroy()) and
I have an AlertDialog and I only want the next Activity to start after
I have a situation like this: start(); <Some code> end(); I want start() function
I want to start a background process in a Java EE (OC4J 10) environment.
I want to start coding in Python or Ruby. Since I own a Lego
I want to start an application which will use ajax push, however the web

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.