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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:52:57+00:00 2026-05-23T11:52:57+00:00

I am deling with web services and I got a problem with my Toast

  • 0

I am deling with web services and I got a problem with my Toast in onpostexecute() method. I am trying to show the toast according to the logcat response.resultsRequestSOAP is a string value I am retrieving from server. If the string value is 1 then I should show “registerd” in toast. If 0 then “Try again” and If -1 then “Field is empty”

In my logcat I m getting the response as string value.

The problem is every time I am getting “Try again” toast message.

The problem might be with Boolean(which I m using) instead of primitive value which never returns null. I m confused with this line else if (resultsRequestSOAP.booleanValue()). its not working for me. how to solve this?

plz some one check the code in onpostexecute() and let me know the problem.

I want to compare the value in logcatand show the toast like this.
If its 1 then “Registered”,
If its 0 then “Try again”,
If its -1 then “field should not be empty”

Help is always appreciated…!

    public class Register extends Activity {

       public static final  Boolean resultsRequestSOAP = null;

    @Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

 private class RegisterTask extends AsyncTask<Void, Void, Boolean> {
      private final ProgressDialog dialog = new ProgressDialog(Register.this);

      protected void onPreExecute() {
         this.dialog.setMessage("Registering...");
         this.dialog.show();


 public Boolean register() {

  // code for webservices********  
     }

 return resultsRequestSOAP;

protected void onPostExecute( Boolean resultsRequestSOAP) {
         if (this.dialog.isShowing()) {
            this.dialog.dismiss();
         }
         if (resultsRequestSOAP == null) {
             Toast.makeText(Register.this.getApplicationContext(), "Try Again", Toast.LENGTH_SHORT).show();
         }

         else if (resultsRequestSOAP.booleanValue()) {
         //also show register success dialog
             Toast.makeText(Register.this.getApplicationContext(), "Registerd", Toast.LENGTH_SHORT).show();


         }
         else{
             Toast.makeText(Register.this.getBaseContext(), "Field is empty", Toast.LENGTH_SHORT).show();
         }
         super.onPostExecute(resultsRequestSOAP);
      }
  • 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-23T11:52:58+00:00Added an answer on May 23, 2026 at 11:52 am
            protected void onPostExecute( Boolean resultsRequestSOAP) {
                     if (this.dialog.isShowing()) {
                        this.dialog.dismiss();
                     }
                     sendResult(resultsRequestSoap);
    super.onPostExecute(resultsRequestSOAP);
    
    
        }
    

    put this method on outer class

    public void sendResult(String resultsRequestSoap){
    if (resultsRequestSOAP == null) {
                     Toast.makeText(this, "Try Again", Toast.LENGTH_SHORT).show();
                 }
    
                 else if (resultsRequestSOAP.booleanValue()) {
                 //also show register success dialog
                     Toast.makeText(this, "Registerd", Toast.LENGTH_SHORT).show();
    
    
                 }
                 else{
                     Toast.makeText(this, "Field is empty", Toast.LENGTH_SHORT).show();
                 }
    
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I do not have much experience coding systems dealing with web-services. Please help me
I am new to web services. I am dealing with testing APIs in my
We're building a set of external web services to be consumed client-side (using jquery/AJAX)
I'm dealing with web services (wsdl, ksoap) on Android. After submitting the details (like
Hi guys I ran the analyser on http://www.websiteoptimization.com/services/analyze/ and I got a number of
What are approaches to test custom clients for public web services? Today there are
Search engines (or similar web services) use flat file and nosql databases. The structure
We are working with a set of web services and we're looking for the
Our system communicates with several web services providers. They are all invoked from a
Currently I am dealing with a web application which uses a txt file as

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.