1

I usually set automatic login via editTextUn.setText(userName) and editTextPw.setText(password) and surround it in if (BuildConfig.DEBUG) {}. As you can guess, this way I don't have to type login details during the development.

I usually have multiple login accounts and I simply swich the one I want to use in the code by (un)commenting it. Something like

if (BuildConfig.DEBUG) {
            edtEmailID.setText(username1);
            edtpassword.setText(pass1);

            //            edtEmailID.setText(username2);
            //            edtpassword.setText(pass2);
//...and so on

However, Android Studio Instant Run does NOT recognize this action.

Namely, when I comment out the one I don't want to use any more and activate the one I want to use, and press Run, the Instant Run refreshes the login screen, but the old (previous) login details remain filled.

Is this a bug in Android Studio or I am doing it wrongly?

MikeT
  • 51,415
  • 16
  • 49
  • 68
sandalone
  • 41,141
  • 63
  • 222
  • 338

0 Answers0