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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:54:40+00:00 2026-06-05T15:54:40+00:00

I have the following scenario: in activity A, when a user clicks a button,

  • 0

I have the following scenario: in activity A, when a user clicks a button, the app sends a request to the server to retrieve some information, then this information is placed into an intent to start activity B.

In activity B, in onCreate method, I do setContentView(R.layout.activity_b) (this layout is quite complex, so even inflating it from XML takes a while), then do a bunch of initialisation. Finally, in onStart I do some final preparation/arrangements of the components.

In activity A, when the user presses a button, I start an AsyncTask, which gets the info from the server and starts activity B, passing the required info into intent. When I call ‘startActivity’, the window of activity B slides into position straight away, however it may take a few seconds to complete the initialisation. During these seconds, I see a black screen. Then, finally, the onStart is executed and everything goes on.

What I would like to do is to complete all this initialisation off-screen, before activity B slides into view, so that when it “arrives”, all the layout is already present. Any ideas how to achieve this?

  • 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-05T15:54:41+00:00Added an answer on June 5, 2026 at 3:54 pm

    I don’t think you can. Activities by their nature are only “alive” while they are showing on the screen.

    So I think there is no way that you can signal an Activity to start doing work (i.e. instantiating Views) without it being in foreground on the screen.

    I would say that your best option for better user experience is to use some kind of progress indicator that shows the user things are loading, and then is hidden once the loading is complete.

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

Sidebar

Related Questions

I have the following scenario: A user shelves some changes. Time goes by and
I have the following scenario: - 64bit Windows Server 2008. - 32bit .NET application
I have a following scenario in my SQL Server 2005 database. zipcodes table has
I have the following scenario, I want to create a DataGrid and then populate
I have the following scenario: User X logs in to the application from location
The scenario is the following: I have an activity RunTrainingWorkoutsView that uses XML layout
I have following scenario. Some people use approach 1 and some use approach 2.
I have following Scenario: PHP(Server, Writer) ----> MySQL Database <------ PHP(Client, Reader/ Writer); PHPS
I have the following scenario (note that activity A has launchMode=singleTop ): Activity A
I have the following scenario: I have a chat activity, in it's intent it

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.