if(edit1.getText().equals("") || edit2.getText().equals(""))
{
//toast the error message
Dialog dialog=new Dialog(getApplicationContext());
LinearLayout llView=new LinearLayout(getApplicationContext());
EditText editText1=new EditText(getApplicationContext());
EditText editText2=new EditText(getApplicationContext());
wsutText2.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable s) {
//do your calculations
}
public void beforeTextChanged(CharSequence s, int start, int count, int after){}
public void onTextChanged(CharSequence s, int start, int before, int count){}
});
editText2.addTextChangedListener(new TextWatcher(){
public void afterTextChanged(Editable s) {
//do your calculations
}
public void beforeTextChanged(CharSequence s, int start, int count, int after){}
public void onTextChanged(CharSequence s, int start, int before, int count){}
});
llView.addView(editText1);
llView.addView(editText2);
dialog.setContentView(llView);
dialog.show();
return;
}