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

The Archive Base Latest Questions

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

I have an activity that has two tabs and a list view in each.

  • 0

I have an activity that has two tabs and a list view in each. I want to make loading and opening of the activities very fast. I’m worried that populating both list tabs will cause the app to lag when that acivity opens. I’m thinking of loading data from my database during the splash screen of my app and creating an array of views, then simply throwing them onto the listviews once that acivity is launched. Is this worth the effort? I can’t seem to find a simple way to do something like this. I’m assuming I will need custom array adapters. Does anyone have any experience doing somethng like this? Or would you just recommend sticking to the standard of using a cursor adapter in onCreate() ?

  • 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-21T03:16:44+00:00Added an answer on May 21, 2026 at 3:16 am

    The question what’s the reason for that you need to load them that fast. In general items can be read from a database really fast. Never the less you should do this in an AsyncTask so you won’t block the UI thread with this operation.

    Another point is, if you want to display items from a database within a ListView you shouldn’t read all the item at once and put them into an array that you bind to the list. Instead you should use the Cursor you got from the database query and bind it to a SimpleCursorAdapter or CursorAdapter which you then bind to the ListView. CursorAdapters are optimized to read data from a Cursor as they are needed. Remember that creating objects is an expensive operation on Android which should be avoided if unnecessary. So if your lists a really large and the user properly won’t always scroll through the whole list then why preloading all items and creating views for it?

    You can of course prequery the database during the splash screen and store the returned cursors somewhere until you need them.

    But as I said at the beginning I don’t know what your application does so it is hard to say if it is worth the effort or not.

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

Sidebar

Related Questions

I have a TabActivity that has a TabHost with two tabs. Each tab has
I have an activity that has a TabHost containing a set of TabSpecs each
Hey, I have a TabHost with two tabs, each with an Activity. The first
I have an activity that has two layouts one in the folder layout and
I have a mapView activity that has a LocationListener registered to check for a
I have two activities, activity 1 and activity 2 for example. Activity 1 will
I have an activity that has properties that look something like this (they're set
I'm trying to write an android application that has two main activities: login screen
I have three activities that I can call A, B and C. I want
I have a activity that I want to rotate. I use the following in

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.