how to check empty edittext in android
<p>my code doesnot print empty edit text itry  trim  stirng .length==00 but is not workw hat wrong in my code?? how do my code check if edittext is empty before sumbit quiry
   i want to check beofre sumit method is edittext is empty?if is empty then print toast message</p>

<pre><code>public class AgAppTransPayExternalAccount  extends Activity {

TextView lblTPEAWelcomeToPayExternalAccountPage;
TextView lblTPEAOtherAccount;
TextView lblTPEAPinno;
TextView lblTPEAAmount;

EditText txtTPEAotheraccount;

EditText txtTPEApinno;

EditText txtTPEAamount;


Button btnTPEAsubmit;
Button clearTPEAButton;
Button btnTPEAgoback;
String sms;
public  static ProgressDialog PayExternalAccountProgressDialog = null;
public  static  boolean value=true;

public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.agapptranspayexternalaccount);
    sms=LoginScreen.item.toString();

    /*

    lblTPEAWelcomeToPayExternalAccountPage = (TextView)  
  findViewById(R.id.lblTPEAWelcomeToPayExternalAccountPage);
    lblTPEAWelcomeToPayExternalAccountPage.setText("Welcome To Pay External  
 Account Page");


   lblTPEAWelcomeToPayExternalAccountPage.setTextColor(getResources().getColor
   (R.color.text_color_black));
    */

    lblTPEAOtherAccount = (TextView) findViewById(R.id.lblTPEAOtherAccount);
    lblTPEAOtherAccount.setText("Other Account :");

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



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

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

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

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

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

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

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

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

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

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


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

    {
        txtTPEAotheraccount.setText("");
        txtTPEApinno.setText("");
        txtTPEAamount.setText("");

            }
      });

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

    {
        finish();

             }
       });
  btnTPEAsubmit.setOnClickListener(new OnClickListener()
    {
    public void onClick(View v)

    {
        String tpeapinemptycheck = txtTPEApinno.getText().toString();
        String otheraccountemptycheck =  
                    lblTPEAOtherAccount.getText().toString();
        String amountemptycheck = txtTPEAamount.getText().toString();

         if  (tpeapinemptycheck.trim().equals("")|| 
  (otheraccountemptycheck.trim().equals("")) ||(amountemptycheck.trim().equals("")))
         {
         Toast.makeText(getApplicationContext(), "Please Enter   
   Correct Information", Toast.LENGTH_LONG).show();
                  } 

         else
                    showProgress();
                submitPEA();

    }
    });

     }

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

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

message="AGPEA"+AgAppHelperMethods.varMobileNo+AgAppHelperMethods.

  arMobileNo+txtTPEAotheraccount.getText().toString()+AgAppHelperMethods.
 varMobileNo+txtTPEApinno.getText().toString()+txtTPEAamount.getText().toString();
     smsmanager.sendTextMessage(mobilenumber, null, message, null, null);
         }
 else
    { 

         Intent j = new Intent(AgAppTransPayExternalAccount.this, AgAppTransPEAResponse.class);


        Bundle bundle = new Bundle();
         bundle.putString("txtTPEApinno", txtTPEApinno.getText().toString());


     bundle.putString("txtTPEAotheraccount",txtTPEAotheraccount.getText().toString());
         bundle.putString("txtTPEAamount",txtTPEAamount.getText().toString());
         j.putExtras(bundle);


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

 }


  }
private void showProgress()
{    

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