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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:16:14+00:00 2026-06-15T15:16:14+00:00

I have a simple program that aks questions then call a php file saying

  • 0

I have a simple program that aks questions then call a php file saying if the answer was a yes or a no.

Right now it works but there is a slight pause when the information is being send. I would like some kind message or indicator to come up showing the computer is busy.

Now when I chnage the text of a textvue, before I send the data, the textView does not change, I allso tried to call it’s update methed

code

case R.id.butYes:
                mSend .setText("Sending your vote to server");
                mSend.invalidate();
                 TalkToServer( mYes[mPes-1] );
                UpdateScreen(); 
                mSend .setText("");
                break;

       String TalkToServer( String addr)
       {   
           HttpClient httpclient = new DefaultHttpClient();
           HttpPost  httppost = new HttpPost(addr);

            HttpResponse response;
            String responseBody=new String("");
            try {
                response = httpclient.execute(httppost);



responseBody = EntityUtils.toString(response.getEntity());
            } catch (ParseException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            } catch (IOException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }

           return responseBody;
       }
  • 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-06-15T15:16:15+00:00Added an answer on June 15, 2026 at 3:16 pm

    use AsyncTask to avoid hanging of UI when sending data to server just change your code as:

    case R.id.butYes:
      new SendTextOperation().execute("");  
      break;
    
    private class SendTextOperation extends AsyncTask<String, Void, String> {
    
          @Override
          protected void onPreExecute() {
    
            //Update UI here
            mSend.setText("Sending your vote to server");
            mSend.invalidate();
          }
    
          @Override
          protected String doInBackground(String... params) {
                // Talk to server here to avoid Ui hanging 
                TalkToServer( mYes[mPes-1] );
                return null;
          }      
    
          @Override
          protected void onPostExecute(String result) {  
                // Update screen here after talk to server end
                    UpdateScreen(); 
                    mSend .setText("");
          }
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple Java program that takes a .jrxml file, compiles it, then
I have a simple program that creates a thread, loops twenty times and then
i have a simple program that sorts a text file according to length of
I have a simple Java program that reads in a text file, splits it
I have a simple PHP program that list some topics. for example I have
I have a simple program that loads a .json file which contains a funny
Hello i have a simple program that opens up a text file and changes
I have a simple log4j.property file and a simple program that use log4j. But
I have written a simple program that pings three sites and then reacts to
Hi i have made a simple program that plays a video file, i used

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.