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

  • Home
  • SEARCH
  • 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 9027617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:47:15+00:00 2026-06-16T06:47:15+00:00

I have an activity for a splash screen which has only an image in

  • 0

I have an activity for a splash screen which has only an image in the layout. I want to make some Http calls in the background while the splash screen is displayed in the UI thread. But when I execute the AsyncTask the image in the layout is not displayed. I get only a blank screen leading me to believe that the layout itself is not loaded. Below is the activity code.

protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash_screen);
        String authReqResponse;
        Toast errorDisplayToast = new Toast(this);

        AuthorizationRequest authReq = new AuthorizationRequest();
        authReq.execute(new Void[] {});

        try {
            authReqResponse = authReq.get();
            if(authReqResponse.equalsIgnoreCase(GeneralConstants.AUTH_FAILED_ERROR)) {
                errorDisplayToast.makeText(SplashScreen.this, R.string.request_auth_failed_error_message, Toast.LENGTH_LONG);
                errorDisplayToast.show();
            } else if(authReqResponse.equalsIgnoreCase(null)) {
                errorDisplayToast.makeText(SplashScreen.this, R.string.networkErrorMessage, Toast.LENGTH_LONG);
                errorDisplayToast.show();
            } else {
                GeneralConstants.REQ_TOKEN = authReqResponse;
                Intent startARIntent = new Intent(SplashScreen.this, MainActivity.class);
                startActivity(startARIntent);
                finish();
            }
        } catch(Exception e) {
            e.printStackTrace();
        }
}
  • 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-16T06:47:17+00:00Added an answer on June 16, 2026 at 6:47 am

    here

    try {
           authReqResponse = authReq.get();///<<get method of AsyncTask
    
               //your code....
    

    as doc as about AsyncTask. get (long timeout, TimeUnit unit) :

    Waits if necessary for at most the given time for the computation to
    complete, and then retrieves its result.

    means if you use this method for getting result back from AsyncTask to your UI main Thread then it will stop your main UI execution until result not returned form AsyncTask’s doInBackground method

    solution is use onPostExecute for updating UI elements when AsyncTask execution complete

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

Sidebar

Related Questions

I have a splash screen in my application which show a splash image while
I have a fairly basic app that only has two Activities, the splash screen
I have an app that displays a splash screen. The splash screen activity creates
in my app i have activity with XML layout, i want to build an
I have an activity with the following layout. So in this screen, initally the
I have an app start by Splash activity screen for 5 seconds Then open
I have the main activity which launches a loading screen activity. When the loading
I have an app which starts from a splash screen and then navigates to
I have a splash screen that i want to run before my main app
I'm obviously doing something wrong. On my splash screen, when it decides which activity

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.