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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T11:11:36+00:00 2026-06-11T11:11:36+00:00

i am new to Android development. I have two activities A and B .

  • 0

i am new to Android development. I have two activities A and B. In activity A I use a xml parser to gain objects with each about 10 strings included. I want to pass these objects to activity B and there should be a listview showing all the objects. Clicking on a object in the listview should show the 10 strings.

I am not sure if I have to use a SQLite database or if I only can use SharedPreferences?
Or can I even store it on the internal memory?

The objects should be saved even if i kill the app.

Hope someone can give me some hints, thanks!

  • 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-11T11:11:37+00:00Added an answer on June 11, 2026 at 11:11 am

    this may helps you

    you can pass your string data both way as you like [1] Using Intent [2] Using Share Prefrence

    like [1] Intent
    in your First ActivityA

                Intent myintent= new Intent(FirstActivity.this,SecondActivity.class);
                myintent.putExtra("Name1", "your String");
                myintent.putExtra("Name2", "your String");
                myintent.putExtra("Name3", "your String");
                myintent.putExtra("Name4", "your String");
                startActivity(myintent);
    

    in Second ActivityB

        Intent myintent = getIntent();
        if(null!=myintent.getExtras()){
        String Name1 = myintent.getExtras().getString("Name1");        
        String Name2 = myintent.getExtras().getString("Name2");        
        String Name3 = myintent.getExtras().getString("Name3");        
        String Name4 = myintent.getExtras().getString("Name4");        
        Toast.makeText(getApplicationContext(),""+Name,12).show();                              
    
        }
        else
        {
            Toast.makeText(getApplicationContext(),"No Recor Here..",12).show();
    
        }
    

    like SharedPreferences[2]
    in your First ActivityA

               Intent myintent= new Intent(FirstActivity.this,SecondActivity.class);
                SharedPreferences spref = this.getSharedPreferences("mynotifyid", MODE_WORLD_WRITEABLE);
                SharedPreferences.Editor spreedit = spref.edit();
                spreedit.putString("Name1", str1.toString());   
                spreedit.putString("Name2", str2.toString());   
                spreedit.putString("Name3", str3.toString());   
                spreedit.putString("Name4", str4.toString());   
                spreedit.commit();
                startActivity(myintent);
    

    in your Second ActivityB

            SharedPreferences spref = context.getSharedPreferences("mynotifyid", Context.MODE_WORLD_WRITEABLE);
            String str1 = spref.getString("Name1","");
            String str2 = spref.getString("Name2","");
            String str3 = spref.getString("Name3","");
            String str4 = spref.getString("Name4","");
    

    for your object saving purpose use SharedPreferences

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

Sidebar

Related Questions

I'm very very new on Android development. I have designed two xmls layouts (main.xml
I am new to Android development. I have an activity in which I would
I am new to android development and I have a question about the insert
I am brand new to Android development and have gotten through these two resources
I am brand new to Android development and have gotten through these two resources
I am new to Android development and I have a question about setting weight
I'm new in android development. I have been trying to start a new activity
I am new to android development. If I have more than one xml file,
New to Android development and have decided to use NetBeans 6.9.1 as my IDE.
I am New Android development. In My application I have two ArrayLists. One ArrayList

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.