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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:29:17+00:00 2026-06-10T08:29:17+00:00

I am developing my first android Application and hoping to get some tips here.

  • 0

I am developing my first android Application and hoping to get some tips here.

I am getting a JSONObject from an url which then will be parsed in an ArrayList<MyObject>. The list will be used in multiple tabs and be filtered as needed for the tabs. The objects within these list can be modified by the user and the changes should be synchronized with the lists.

So, to speed up loading time I have created a class DataHolder as a singleton which contains 7 arraylist, based from the one JSONObject in different sorting order and filter criterion. The objects in these lists are references from the original list. Populating the lists works fine.

The lists will be used in different fragments and activities.

Now the problem: the second activity contains tabs with fragments. After initializing the fragment… all arraylists in the DataHolder counts 0! I have to save the JSONObject in SharedPreferences and populate it again to get the List. I can’t load the url again because it is slowing down the app to much and using SharedPreferences is not an option (I think) because of the need to synchronized the Lists. I have read that using static variables is not the optimal solution, but it seems to be the easiest way 🙁

What can I do to solve this problem? Should I use Parcelable Objects and always pass the Lists around? Or maybe use SQLite? Or are there other approaches?

  • 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-10T08:29:19+00:00Added an answer on June 10, 2026 at 8:29 am

    The SQLite way is definitively the correct approach, imho.

    You should use the internal database to store such lists :
    http://developer.android.com/guide/topics/data/data-storage.html#db

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

Sidebar

Related Questions

I'm developing my first Android application and it is based partly on displaying some
I am developing an android application in which I have passed a string from
I'm developing an application on the Android system which involves parsing some xml stuff.
I am developing my first Seam + Android application and I am facing some
I'm having a go at developing my first android application and have never really
I have been developing Android application which has 3 ListView and one ContextMenu for
I'm developing my first Android application, and I'd like to create a settings screen.
I am currently developing my first Android application by reading Dev Documentation at Android
I am developing one Android application in three languages named English,Spanish and German.First I
I start developing a new Android application from scratch these days. The company I

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.