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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:47:58+00:00 2026-05-27T23:47:58+00:00

I have 4 Views and I want that the first View gets Visible then

  • 0

I have 4 Views and I want that the first View gets Visible then after two seconds Invisble then should the next View get Visible and after 2 seconds again Invisible and so on to infinity which View is selected this is random.

Up to know I tried to make 4 Threads for each View one, so whenever a View is selected the corresponding Thread is started. When just one View is selected this works very well I worked with handler.sendEmptyMessage(0) for setting the View Visible
and handler.sendEmptyMessageDelayed(1, 2000) for setting the View Invisible after 2 seconds.

But when more Views than one are selected this only works for the last View, which was selected.
And I think this is the case, because the MainThread executes his MessageQueue only after all Threads are done with work. So I need a Method that the MessageQueue is always executed(And UI changed) when a Thread is finished.

Thanks!!

  • 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-27T23:47:59+00:00Added an answer on May 27, 2026 at 11:47 pm

    When you have multiple threads running, you have no way of guaranteeing that any particular one will run before / during / after another.

    It would be better to simply have one thread that sends an empty message every two seconds. When that message is received, hide the previously visible View, randomly select the next one to show, and show it.

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

Sidebar

Related Questions

In my application I want to have one view that holds 2 partial views.
I have such view that handles user registration. After creating new user i want
I have the next script, /cashflow/arrow/ calls a django view that gets the data
I have an application that loads a cell in various table views. I want
I have a view that I want to be converted into JSON. What is
i have a scroll view in my application and i want that when the
I have an index view that I want to update automatically as the user
I have a partial view that I want to basically take care of itself
I have a view that has a tooltip attribute. I want to set that
I have a view in SQL Server 2008 that I want to use for

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.