Toast error message prints when successful
<p>My code is shown below. It always shows a request time out message if there is a successful login or no login for 15 seconds. The "Request timeout"  Toast message always prints if the submit was successful.  How do i stop "Request time out" toast from printing? It should only print when the application process is not successful for 15 seconds.</p>

<pre><code>import android.widget.TextView;
import android.widget.Toast;

     public class AgAppTransPayToLinkAccount extends Activity {


    TextView lblPTLWelcomeToPayToLinkAccountPage;
    TextView lblPTLPinno;
    TextView lblPTLAmount;

    EditText txtPTLpinno;
    EditText txtPTLamount;

    Button btnPTLsubmit;
    Button clearPTLButton;
    Button btnPTLgoback;

  boolean value=true;


    String sms;
    ProgressDialog PayToLinkAccountProgressDialog = null;
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.agapptranspaytolinkaccount);
        sms=LoginScreen.item.toString();



        lblPTLPinno = (TextView) findViewById(R.id.lblPTLPinno);
        lblPTLPinno.setText("PIN Number :" );

        txtPTLpinno=(EditText) findViewById(R.id.txtPTLpinno);


        lblPTLAmount = (TextView) findViewById(R.id.lblPTLAmount);
        lblPTLAmount.setText("Amount :" );


        txtPTLamount=(EditText) findViewById(R.id.txtPTLamount);

        btnPTLsubmit =(Button) findViewById(R.id.btnPTLsubmit);


     btnPTLsubmit.setTextColor(getResources().getColor(R.color.text_color_blue));

        btnPTLsubmit.setOnClickListener(new OnClickListener()
        {
        public void onClick(View v)

        {
            showProgress();
            submitPTLA();

        }

  });


    clearPTLButton =(Button) findViewById(R.id.clearPTLButton);


        clearPTLButton.setTextColor(getResources().getColor(R.color.text_color_blue));



    clearPTLButton.setOnClickListener(new OnClickListener()
        {
        public void onClick(View v)

        {


                txtPTLpinno.setText("");
                txtPTLamount.setText("");

        }

  });


    btnPTLgoback=(Button) findViewById(R.id.btnPTLgoback);

       btnPTLgoback.setTextColor(getResources().getColor(R.color.text_color_blue));


    btnPTLgoback.setOnClickListener(new OnClickListener()
            {
            public void onClick(View v)

            {
                finish();

            }
            });

         }

    private void submitPTLA() {
         String message;
        String mobilenumber= LoginScreen.smsmobileno;


         if (txtPTLpinno.getTextSize()==0 ||txtPTLamount.getTextSize()==0)
         {

             AlertDialog.Builder altDialog= new AlertDialog.Builder(this);
             altDialog.setMessage("Please Enter Complete Information!");

         }
         else
         {

             if (( sms.compareTo("SMS")==0))
                 {
                 SmsManager smsmanager = SmsManager.getDefault();


      message="AGLIA"+AgAppHelperMethods.varMobileNo+AgAppHelperMethods.varMobileNo+
       txtPTLpinno.g
      etText().toString()+txtPTLamount.getText().toString();
     smsmanager.sendTextMessage(mobilenumber, null, message, null,null);
         }
             else
            { 

             Intent j = new   

         Intent(AgAppTransPayToLinkAccount.this,AgAppTransPTLAResponse.class);


             Bundle bundle = new Bundle();



                bundle.putString("pinno",txtPTLpinno.getText().toString());


                bundle.putString("amount",txtPTLamount.getText().toString());


                j.putExtras(bundle);


             startActivity(j);
        value=false;
             PayToLinkAccountProgressDialog.dismiss();


        }


      }

      }
    private void showProgress()
    {    

        PayToLinkAccountProgressDialog =   
     ProgressDialog.show(AgAppTransPayToLinkAccount.this,null, "Processing please 
       wait...", true); 
        if (PayToLinkAccountProgressDialog != null) {
            try
            {
            Handler handler = new Handler();
            handler.postDelayed(new Runnable()
            {
            @Override
            public void run()
            {
                PayToLinkAccountProgressDialog.dismiss();
    if(value)
                {
                Toast.makeText(AgAppTransPayToLinkAccount.this, "Request   
     TimeOut " , Toast.LENGTH_SHORT).show();
     }
            }
            }, 15000); // &lt;--- here is the time adjustment.
            }
            catch (Exception e)
            {
            }
            }
    }
      }
</code></pre>
