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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:44:54+00:00 2026-05-21T23:44:54+00:00

hi all since i am using a button and on the click of that

  • 0

hi all
since i am using a button and on the click of that button it connects to a Web Service.
But the problem is that when i press the button it does not showed me that it has been clicked and goes to connect to the internet and web service. after connecting it shows me the response that it has been clicked. in short the response of button is very slow. if that buton has some INternet connectvity in its Listener.
i know it has something to do with UI thread. but please friends guide me through this.

Thanks a bunch,

  • 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-21T23:44:55+00:00Added an answer on May 21, 2026 at 11:44 pm

    Put the following code in your class:

     // Need handler for callbacks to UI Threads
        // For background operations
        final Handler mHandler = new Handler();
    
        // Create Runnable for posting results
        final Runnable mUpdateResults = new Runnable() {
            public void run() {
                // Do your task which needs to get done after webservice call is complete.
            }
        };
    

    And for calling the webservice use the following code in button event:

    new Thread() {
                public void run() {             
                    // Place the webservice call here.   
    
                    mHandler.post(mUpdateResults);
                }
                }.start();
    

    Actually what are you looking for is multithreading, all the webservice calls and network activities should go in separate thread.
    After the thread start() call you can do what ever you want and would be done instantly without any delay (in your case showing that button pressed).

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

Sidebar

Related Questions

Newbie question since I'm not up to speed using maven at all. I'm trying
I'm developing a game using cocos2d v2.0 beta2. Since i worked with iOS5.0 all
I cannot run ['abc'].append( MyModel.objects.all() ) since it generates exception 'NoneType' object is not
I have a problem I am using jquery U.I tabs that load everything with
I have searched this web looking for an answer, but it seems that this
Im using jQuery to create button that will show Photos with absolute position. However,
I have seen numerous advice on stackexchange and all over the web suggesting that
So I have an app that has a button where when you click it
I'm curious if this is possible at all since a select * from html
So I have a connection pool setup. Which is great and all since I

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.