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

  • Home
  • SEARCH
  • 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 4259462
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T05:47:16+00:00 2026-05-21T05:47:16+00:00

Possible Duplicate: How to pass a value from one Activity to another in Android?

  • 0

Possible Duplicate:
How to pass a value from one Activity to another in Android?

I have an activity with a list of titles and their bodies(content) (list6 example from ApiDemos). And I have an activity, where I add a note. When I click on “Add” button, I want the title of my note to appear on the list. Same with body. The problem is, that in List activity there are two String[] arrays with predefined hard-coded titles and bodies. What should I do to be able to add my own new titles with a content instead of having these hard-coded values?
I know I must use intents with startActivityForResult, but that’s probably all I know…

  • 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-21T05:47:17+00:00Added an answer on May 21, 2026 at 5:47 am

    You have two option:

    1) make the listview and the two arraylists static

    This way you can use the same instances of it from the activity with add button and modify the listview as:

    FirstActivity.listTitlesArrayList.add(listTitleString);
    FirstActivity.listDescriptionArraylist.add(listDescriptionString);//this is probably your note
    FirstActivity.listView.invalidateViews();
    

    2)if you want to use intents:

    while going to the ListActivity pass data by..

    intent.putExtra("Title", listTitleString);
    intent.putExtra("Content", listDescriptionString);
    startActivity(intent);
    

    and to recover it in second activity use:

    title= getIntent().getExtras().getString("Title");
    

    …and so on..

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

Sidebar

Related Questions

Possible Duplicate: How to pass object from one activity to another in Android I
Possible Duplicate: pass data from Action To Another Action I have a view in
Possible Duplicate: How to Pass String to another forms from one form in c#
Possible Duplicate: How to pass value from javascript to php file would something like
Possible Duplicate: Passing data between asp.net pages how to pass value of TEXTBOX from
Possible Duplicate: jQuery mobile passing parameter from one page to another I need to
Possible Duplicate: Passing a Int value to another class I have been trying to
Possible Duplicate: asp.net pass a value into next page I am requesting quantity from
Possible Duplicate: How to call a JavaScript function from PHP? I have a php
Possible Duplicate: Is Java pass by reference? I have a question about passing by

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.