I have a problem that I'm trying to solve, I'm trying to create a small login page I am able to, but as long as the username and password are correct as much as you want, but when the credentials are wrong, when you click the button to screen a screen completely white?
edit public square SplashActivity activity expansion (private TextView user name Personal Text View Paswardadit; private GetEsercenteForLogin authTask = null; private view mLoginStatusView; private linear Lyaut Splasleaut; saved create (bundle on public void InstanceState) {setRequestedOrientation (activityInfo.SCREEN_ORIENTATION_LANDSCAPE); requestWindowFeature (Window.FEATURE_NO_TITLE);. GetSwitch Username); PasswordEdit = (TextView) findViewById (R.id.password_login); MLoginStatusView = frame Nden Vibibaiaidi (Arkdiklin_stats); SplashLayout = (linear Lyaut) searching for Vivibiaiaidi (Arkaid. Splash_layout); super.onCreate (savedInstanceState); button Btnaantretro = (Button) searching for ViewById (R.id.button_entra); buttonEntra .setOnClickListener (New View.OnClickListener) {@Override Public Zero onClick (see v) {CharSequence usernameEditText = usernameEdit.getText (); String user name = usernameEditText.toString (); CharSequence passwordEditText = passwordEdit.getText (); String password = passwordEditText.toString (); Checkin (username, password);}}); } Public Zero Check Login (String Username, String Password) {if (authTask! = Null) {return; } Username Eidit.setError (empty); PasswordEdit.setError (zero); Boolean cancellation = false; See Focusview = Null; String mPassword = passwordEdit.getText (). ToString (); String muun name = username.edit.gettext (). ToString (); If (TextUtils.isEmpty (mPassword)) {passwordEdit.setError (getString (R.string.error_field_required)); FocusView = passwordEdit; Cancellation = true; } If (textualisyisyisytym)) {usernameEdit.setError (getString (R.string.error_field_required)); FocusView = Edit User Name; Cancellation = true; } And if (! MUsername.contains ("@")) {usernameEdit.setError (getString (R.string.error_invalid_email)); FocusView = Edit User Name; Cancellation = true; } If (Cancel) {focusView.requestFocus (); } Else {Log.i (SplashActivity.class.getName ()), "OnlineOnline:" + session utility.online (this)); If (session's ability. This online (this)) {show progress (true); AuthTask = new GetEsercenteForLogin (this) {@Override protected void onPostExecute (EsercenteBean esercente) {authTask = null; ShowProgress (false); If (esercente == null || esercente.getEsitoLogin () equals ( "right").) {UsernameEdit.setError (GetString (R.string.error_incorrect_user)); UsernameEdit.requestFocus (); SplashLayout.requestLayout (); } Super.onPostExecute (Essence); } @ Override protected cancel (void) (show progress (false); SuperkonCancelled ();}}; AuthTaskkexecute (username, password);} else {String text = "Nesun Knnesion" REFERENCES = getApplicationContext (); Int Length = toast. toast toast = toast. Make text (context, text, period); Toastkshow (); toast. Setgraviti (Gravity. Siantiiaartioel, 0, 0);}}} @TargetApi (Build. VERSION_CODES.HONEYCOMB_MR2) Private zero showProgress {if (Build.VERSION.SDK_INT> = Build.VERSION_CODES.HONEYCOMB_MR2). {Int shortAnimTime = getResources () getInte ger (android.R .integer.config_shortAnimTime); mLoginStatusView.setVisibility (View.VISIBLE);. MLoginStatusView.animate () setDuration (shortAnimTime) .alpha (show 1: 0) .setListener (New AnimatorListenerAdapter () {@Override public Zero onAnimationEnd (animator animation) {mLoginStatusView.setVisibility (ShowView.VISIBLE: View.GONE);}})}} Else {// ViewPropertyAnimator API is not available, so just show // and hide relevant UI components MLoginStatusView.setVisibility (Show? View visible: see GONE); }}}
No comments:
Post a Comment