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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:03:29+00:00 2026-05-29T16:03:29+00:00

I have created a Handler instance in the main ui thread(mUIHandler) and from a

  • 0

I have created a Handler instance in the main ui thread(mUIHandler) and from a worker thread(other thread) when i am trying to execute the run method of the runnable the run method gets executed almost 9 out of 10 times but there is that 1 time when it doesn’t get executed.

mUIHandler.post(uiRunnable) –> does it not always guarantee to execute the run method present in the runnable?

I even added log methods to check and could see that the logs till the post method innvocation gets executed but the run method logs don’t get displayed.

How does the post(runnable) work internally? does it guarantee that the ui thread(thread with the handler) will excute this as soon as post is invoked?

Any help would be appreciated.

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-29T16:03:30+00:00Added an answer on May 29, 2026 at 4:03 pm

    I have never seen a Handler not properly run the posted runnable. Some things to investigate:

    1. Is there any logic that might result in a race condition between data the thread could be potentially interacting with while the UI-thread runnable is executing?
    2. Do you have a try/catch anywhere that might be silently eating an exception?

    My vote (without having seen your code) is that it’s probably #1. You wouldn’t be the first person to fall victim to hard-to-track-down race conditions as a result of concurrent logic.

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

Sidebar

Related Questions

I have to execute some code in the context of the main thread. I
I have created an ashx handler that returns an image to my flex app.
I have an onclick handler for an <a> element (actually, it's a jQuery-created handler,
I have simple SSIS package in which On Error event handler I have created
I have two HANDLEs and they are created from the same file, in such
I have written an event handler method and attached it to the Paint event
I have 3 python modules. LogManager.py Runner.py Other.py Runner.py is the first main module
I have 2 assemblies, A containing the Main method and the Foo class, that
I have created HTTP handlers. How do I create global variables for these handlers
I have created a user control to handle adding comments to certain business entities,

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.