Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to check edit text is empty
    primarykey
    data
    text
    <p>I am developing a application in which if i click a button it woul d check that all the edit text are empty or something written and providing similar alert box for that message.I had made a method and calling it in Onclick event.But i am not able to get the desired result as syntax error is not dr even logcat not showing any error please help me out...Thanks in advance..</p> <pre><code> ImageButton b2=(ImageButton)findViewById(R.id.imageButton2); b2.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { checkValue(); } private void checkValue() { EditText e = (EditText) findViewById(R.id.editText1); EditText e1 = (EditText) findViewById(R.id.editText2); EditText e2 = (EditText) findViewById(R.id.editText3); EditText e3 = (EditText) findViewById(R.id.editText4); EditText e4 = (EditText) findViewById(R.id.editText5); EditText e5 = (EditText) findViewById(R.id.editText6); String f = e.getText().toString(); String f1 = e1.getText().toString(); String f2 = e2.getText().toString(); String f3 = e3.getText().toString(); String f4 = e4.getText().toString(); String f5 = e5.getText().toString(); if ((f.length()&gt;0)&amp;&amp;(f1.length()&gt;0)&amp;&amp;(f2.length()&gt;0)&amp;&amp;(f3.length()&gt;0)&amp;&amp;(f4.length()&gt;0)&amp;&amp;(f5.length()&gt;0)) { AlertDialog alert= new AlertDialog.Builder(Test.this).create(); alert.setTitle("Exception:Incomplete Form"); alert.setMessage("Looks like you missed a field or made a mistake.Please ensure all fields of form are filled.Click OK to go to main page"); alert.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent i=new Intent(Test.this,ShpoonkleActivity.class); } }); } else { AlertDialog alert= new AlertDialog.Builder(Test.this).create(); alert.setTitle("Your Form is successfully processed.Thanks"); alert.setMessage("You are Done! Keep an eye out for a confirmation email. If you don't get one in the next 24h, open this form again, and make sure youremail is correct"); } } }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload