If EditText is empty then Login Button has to be disabled. And if EditText has some texts then Login Button has to be enabled. Well you can see this method on Instagram Login.
Both fields are empty, Sign in Button is DISABLED.

Here Password field is empty, so still Sign inButton is DISABLED.

Here both Username and Password field is not empty, So Sign inButton is ENABLED.

how to achieve these steps?? here is my code and it doesn't work..
EditText et1,et2;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_login_check);
et1 = (EditText) findViewById(R.id.editText1);
et2 = (EditText) findViewById(R.id.editText2);
Button b = (Button) findViewById(R.id.button1);
String s1 = et1.getText().toString();
String s2 = et2.getText().toString();
if(s1.equals("")|| s2.equals("")){
b.setEnabled(false);
} else {
b.setEnabled(true);
}
}