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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:50:10+00:00 2026-05-27T13:50:10+00:00

In my main activity, I would like to have it set up, so that

  • 0

In my main activity, I would like to have it set up, so that I first get met by a contentView just showing a background and some text. After X seconds, I want to change to my other view (GLSurfaceView).

This is obviously something I am doing completely wrong.

This is how I’ve imagined it could’ve been done (it’s all in the onCreate method):

setContentView(R.layout.main);

try {
    Thread.sleep(10000);
} catch (InterruptedException e) {
}

viewer = new Viewer(this);

setContentView(viewer);

Where layout Main is what I want to show at the beginning and Viewer is my GLSurfaceView class.

What happens is that it just goes black for 10 seconds and then it starts loading the objects I’ve got that is shown through OpenGLES.

There’s nothing wrong with the layout Main, since it works if I just erase the lines under where the Thread.sleep takes action. Though, nothing happens before the Thread.sleep is over…

With that said, my questions are following:

  • Why is the contentView not changing until after Thread.sleep is done?
  • What would be an appropiate solution to what I want to achieve?
  • 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-27T13:50:10+00:00Added an answer on May 27, 2026 at 1:50 pm

    I’m assuming this in your onCreate() and thats why you are seeing nothing.

    The way I would implement this is to start a thread using AsyncTask sleep in the doInBackground and in the onPostExecute set up the new view.

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

Sidebar

Related Questions

I have a large png that I would like to use as a background
I have a main Activity and a Dialog through which I would like to
I have a background task I would like to handle. The thing is that
The main activity includes some variables with set values. I created a sub-activity with
I have a design of activities like this I have one main activity and
I have a widget that supposed to call an Activity of the main app
This is the scenario: I have one image background set on an activity. On
I have a text view in my Lyout and I would like to set
I have a EditText on my View and I would like to set a
I would like to achieve this layout : my main activity layout ( main.xml

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.