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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:06:49+00:00 2026-05-28T01:06:49+00:00

An Android application has two activities. Activity A shows a list of items. Activity

  • 0

An Android application has two activities.

Activity A shows a list of items.
Activity B shows some details about a particular item.

The details are loaded from a largish SQLite database. The queries used to generate the data take about 250 to 500milliseconds on a reasonable phone.

My question is what is the best practice for loading the data while providing a nice user experience.

Currently Activity B executes an AsyncTask when it’s created. When the task completes it creates a number of views and adds them to the screen. No data is loaded on the UI thread.

To the user Activity B opens with the nice standard zoom animation and then a fraction of a second later the view populates with data. It looks a little crap IMO.

Another option is to load the data on the UI thread. If I do this at the right time then the screen freezes with the list item selected for 250ms while the data loads and then the view changes with the standard zoom animation but it’s zooming into an already populated view. It looks a lot nicer but I am blocking the UI thread which is not ideal.

What is the best way to achieve a nice transition when the new view isn’t ready yet?

  • 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-28T01:06:50+00:00Added an answer on May 28, 2026 at 1:06 am

    Either put a progress dialog for loading data task and if you don’t then..

    You can use onProgressUpdate() method of your AsyncTask for intervally update your resulted data from database to UI..

     protected void onProgressUpdate(Integer... progress) { 
            //this runs in UI thread so its safe to modify the UI 
            myTextField.append("finished call " + progress); 
        } 
    

    •onProgressUpdate – called whenever publishProgress is called from the background task, used to report progress back to the UI.

    Also you can use LIMIT and OFFSET clause of sqlite database for fetching data from database with bound number of returned result in your select query for fetching large amount of data from database..

    Example:

    Select * from Animals LIMIT 100 OFFSET 50 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Android application that contains two Activities . Activity A has a
I'm trying to write an android application that has two main activities: login screen
I have an Android Honeycomb application with two activities; the first one has a
I’m working on an android application that currently has two Activities, A and B,
I'm building an android application, which has a list view, and in the list
Say I have two Activities in an Android application, EditPerson and EditEmployee . It
Hi Ive written a simple android application with two xml pages, one has an
I have an application that contains two Activities with <intent-filter> <action android:name=android.intent.action.MAIN/> <category android:name=android.intent.category.LAUNCHER/>
I have two activities in my Android 2.1 application. The first is the Main
My application has two activities, that I start in this order: HOME > A

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.