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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:39:52+00:00 2026-05-26T13:39:52+00:00

I stack with this, I’m trying to create application using TabLayout. I have 3

  • 0

I stack with this, I’m trying to create application using TabLayout. I have 3 tabs (3 different activities). I also got service which reads my gps position – that works fine. I got thread which post to the web server user position – that works to.

Now I’m trying to create thread which ask web server if there are any messages for user. If there are – thread try to show custom dialog (2 text views and gallery – it works if i start action from activity by clicking button), and there problem starts I know i can’t update UI form threads different from main thread but i don’t know how to work around this. I tried to use AsyncTask – failed – i don’t want to assign AsyncTask to specific Activity as inner private class.

I wish I could show my custom dialog regardless of the tab on which user is currently using.

Thread works fine, but how to show that dialog.

I read about runOnUIThread but don’t know how to use it.

Any ideas, any similar examples ??

  • 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-26T13:39:53+00:00Added an answer on May 26, 2026 at 1:39 pm

    Using runOnUiThread is easy.

    YourActivity.this.runOnUiThread(new Runnable() {
        public void run() {
            YourActivity.this.showDialog(CUSTOM_DIALOG_ID);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Lucene.Net in an ASP.NET application on a shared host. Got this stack
Using the JavaScript sample found in this stack overflow post you can have a
I have this stack trace (part of) Servlet.service() for servlet action threw exception java.lang.NumberFormatException:
I have a string stack+ovrflow*newyork; i have to split this stack,overflow,newyork any idea??
I have this strange call stack and I am stumped to understand why. It
I have this snippet of the code Stack& Stack:: operator=(const Stack& stack){ if(this ==
So I have this stack: @font-face { font-family: 'MyCustomFont'; src: url('MyCustomFont.ttf') format('truetype'); } body
I have this stack trace error when I try view some data in my
I'm using several response segments which I push on my action stack like this:
So I have here a JavaScript stack built after this function: function Stack() //Creating

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.