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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:31:42+00:00 2026-06-13T20:31:42+00:00

Still working on my skills in android. My problem here is that i have

  • 0

Still working on my skills in android.

My problem here is that i have a label from my database that contain a name that is in a spinner, when i click on the label, a dialog comes and give you three choices:
1. update.
2. delete.
3. cancel.
I got through the second and the third choices, but in the update am facing this problem;
i go to another activity that has an editText and the 2 Buttons, save and cancel, i want the save button to get the data from the editText in putExtra and send it back to the same previous activity and change the old label with the data from the editText.

I appreciate any help.
Thanks in advance.

  • 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-13T20:31:44+00:00Added an answer on June 13, 2026 at 8:31 pm

    In your second activity, you can get the data from the first activity with the method getIntent() and then getStringExtra(), getIntExtra()…

    Then to return to your first activity you have to use the setResult() method with the intent data to return back as parameter.

    To get the returning data from your second activity in your first activity, just override the onActivityResult() method and use the intent to get the data.

    First Activity:

    //In the method that is called when click on "update"
    Intent intent = ... //Create the intent to go in the second activity
    intent.putExtra("oldValue", "valueYouWantToChange");
    startActivityForResult(intent, someIntValue); //I always put 0 for someIntValue
    
    //In your class
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        //Retrieve data in the intent
        String editTextValue = intent.getStringExtra("valueId");
    }
    

    Second Activity:

    //When activity is created
    String value = intent.getStringExtra("oldValue");
    //Then change the editText value
    
    //After clicking on "save"
    Intent intent = new Intent();
    intent.putExtra("valueId", value); //value should be your string from the edittext
    setResult(somePositiveInt, intent); //The data you want to send back
    finish(); //That's when you onActivityResult() in the first activity will be called
    

    Don’t forget to start your second activity with the startActivityForResult() method.

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

Sidebar

Related Questions

Still working on lisp recipes and idioms. I have a list like this: ((a
I'm still working on my leaks problem and I don't know how to solve
I'm currently solving a programming problem to enhance my skills (I'm still a newbie)
I have a problem while working with vectors of a class. I have tried
I'm working with a SQL database for a Skills Matrix application and I need
Still working through JQuery to get data and repopulate portions of a page. Right
I'm still working in my ACL project, and I'd like some ideas for the
I'm still working my way through some pretty basic Actionscript programming (in Flex), and
I'm still working on my little Tkinter project which is simple a logging console
I am still working with securing my web app. I decided to use PDO

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.