public class Util
{
public static boolean isEmpty(EditText etText) {
if (etText.getText().toString().trim().length() > 0) {
return false;
} else {
return true;
}
}
}
..........................
public class MainActivity
extends Activity
{
EditText sample;
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_createaccount);
sample=(EditText)findViewById(R.id.sample);
if(Util.emailValidator(sample)){
// edittext box empty
}
else{
{
public static boolean isEmpty(EditText etText) {
if (etText.getText().toString().trim().length() > 0) {
return false;
} else {
return true;
}
}
}
..........................
public class MainActivity
extends Activity
{
EditText sample;
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_createaccount);
sample=(EditText)findViewById(R.id.sample);
if(Util.emailValidator(sample)){
// edittext box empty
}
else{
}
No comments:
Post a Comment