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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T13:32:23+00:00 2026-06-01T13:32:23+00:00

I’m having trouble putting this problem into searchable terms. I’m working on an Android

  • 0

I’m having trouble putting this problem into searchable terms. I’m working on an Android application, and specifically the splash screen for my app. The app needs to fetch data from an external web service (a blocking function call), while it does this the user gets a nice title, image and progress bar. When the data arrives the user is redirected to the main menu. Its a simple screen, everything being defined in the xml layout file, my problem is that I just get a black screen for a few seconds and then the main menu. If I press back I get the splash screen with the progress bar spinning away happily.

Here is what I have so far:

public class SplashActivity extends Activity{
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.splash);
    }

    @Override
    public void onStart(){
        super.onStart();
        DatabaseManager db = new DatabaseManager(this.getBaseContext());
        db.fetchExternCatalog(); //doesnt return until data arrives
        Intent intent = new Intent().setClass(this, MainMenuActivity.class);
        startActivity(intent);
    }
}

It seems the screen isnt actually drawn until the activity is running (after onCreate(), onStart(), etc). I thought onStart() would be the perfect place to put this, but apparently not.

So how do I draw everything on the screen and make my blocking function call after so the user actually sees the splash screen while the data is downloaded?

  • 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-01T13:32:24+00:00Added an answer on June 1, 2026 at 1:32 pm

    You’re going to be locking up the UI thread which is why i believe you are seeing a black screen. Use an AsyncTask or create your own thread pool for DB operations.

    As far as hitting the back button and seeing your old activity, You need to tell android not to store the activity in it’s stack. This should help:

    http://developer.android.com/guide/topics/fundamentals/tasks-and-back-stack.html

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am currently running into a problem where an element is coming back from
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
For some reason, after submitting a string like this Jack’s Spindle from a text
Specifically, suppose I start with the string string =hello \'i am \' me And
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.