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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:18:02+00:00 2026-05-26T18:18:02+00:00

I have one listView in my app, which i is use to list the

  • 0

I have one listView in my app, which i is use to list the differnt strings by dynamically adding the strings to ArrayList and using that in list view. I have declared this as below

public static List<String> myList = new ArrayList<String>();

this helps me in retaining the values of list even after exiting app, but i cant be able to retain it after i force close the app or cell boots off and on. Is there any way to store this list as we do in shared preference for strings and int?

  • 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-26T18:18:03+00:00Added an answer on May 26, 2026 at 6:18 pm

    Couple of methods.

    1) Store the entire list as a Single String (delimiter separated) and split it when you read it back (depends on what kind of strings, because if you have delimiters inside the string, you’re screwed, although you could use some kinda encoding (Base64))

    2) Store them as separate variables “Key0” is the first element, “Key1” is the second…etc You get the idea…Remember to flush the Keys each time you save though.

    3) Don’t use Shared Preference, instead use a private file and write the entire ArrayList Object (It’s serializable.) using a ObjectOutputStream

    Cheers.

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

Sidebar

Related Questions

I have a tab view which has a listview in one of these tabs.
I have two Activities in my App, one is a ListView which displays a
I'm using Jinja2 on Google App Engine. I have a ListView which renders a
I have an app that uses a tab layout using fragments, in one of
If I have two activities in my app, one with listview and the other
I have a ListView with multiple checkboxes (one for each list item). What would
In WPF app I have a ListView which is connected with ObservableCollection ShQuCollection through
I have two activities one displaying map view and another listview, the main objective
I have one app in which i called the webservice and set the data
I'm creating an android app that requires database connectivity, for which I'm using the

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.