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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:21:29+00:00 2026-05-19T11:21:29+00:00

First some background info and parameters of what I am looking for. The application

  • 0

First some background info and parameters of what I am looking for.

  • The application has several activities that need access to a single list. I am using the Application class in order to maintain this list across all of the activities.
  • The list is a list of a custom object.
  • There is one activity that has a ListView to show the items in this list.
  • There are other activities that need to be able to access this list, but do not show a ListView.
  • The list may be sorted or filtered.
  • The list can be updated (add, remove, update content) from a background thread at any time and those changes should be reflected immediately when viewing the list.

So far my approach is to have the list managed via methods in the Application, including managing any updates to the list. If the user is currently in the Activity with the ListView in it, it is listening for updates to the list. When it hears an update it copies the list from the Application and sends it to the ListViews custom ArrayAdapter. The ArrayAdapter takes this list copy and replaces the base list, calls the current sort and filter on it and then replaces the list that is actually displayed in the list and calls notifyDataSetChanged(). This is all to avoid any issues the Adapter will have if the list changes from off the UI Thread or without having notifyDataSetChanged() called.

This all works just fine, the problem is that with this approach there are multiple copies of the same list which decreases the usability of this list in other places and creates unneeded memory use. It also can create a lot of copying if a lot of updates come in a certain interval.

So I am looking to see if anyone else has any approaches that would allow the ListView to reference the main list source directly but still avoid issues with updating from off the UI thread?

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-05-19T11:21:30+00:00Added an answer on May 19, 2026 at 11:21 am

    I don’t know that my approach is any better. I create an Adapter, which holds a LinkedList of items. I keep a static reference to that Adapter, and when updates are needed, the other Activities,etc. update the List and call adapter.notifyDataSetChanged()

    I think this only uses one copy of the data.

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

Sidebar

Related Questions

First some background: VB.NET 2005 Application that accesses a MS-SQL back-end, using multiple Web
First some background: I'm working on an application and I'm trying to follow MVVM
First, some background: I'm developing a web application using Python. All of my (text)
BACKGROUND INFO: I need to update some data from the web, about every hour
Here's some background info. I have three MySQL tables (all InnoDB). The first table
First, some background info: I am making a compiler for a school project. It
Some background info I am programming in a system that uses a proprietary programming
First some background on the application. I have an application processing many independent tasks
First some background. We have a vendor application which generates logs and configuration files
First some background, we are creating a new eGov application. Eventually, a citizen can

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.