Note that there are some explanatory texts on larger screens.

plurals
  1. POShow progress text while logging user in - Android App
    text
    copied!<p>I'm working on an Android app and am having trouble updating the GUI. Basically what I want to achieve is when my user clicks the Sign In button, call the setVisibility method on the groupLogInProgress as defined below and set it to View.VISIBILE. Then fire off my method that logs them in, and if it returns a success value, set the groupLogInProgress to View.GONE, and the groupLogInSuccess to View.VISIBLE (displays "Sign In Successful!") pause for a few seconds and start my main intent. If my log in method returns a false, have it set the groupLogInProgress to View.GONE and the groupLogInError to View.VISIBLE. I can't seem to figure out how to make these things happen without causing my app to hang while it waits for the log in method to complete. </p> <p>Below is what I have so far, any help is GREATLY appreciated!!</p> <pre><code>//Hide all Sign In progress/success/error layouts onCreate groupLogInProgress = (LinearLayout) findViewById(R.id.groupLoginProgress); groupLogInSuccess = (LinearLayout) findViewById(R.id.groupLoginSuccess); groupLogInError = (LinearLayout) findViewById(R.id.groupLoginError); hideAllStatus(); //this is simple method that sets all above groups to View.GONE //Sign in button onClick handler public void onClick(View v) { loginData = LogInUser(username, password); if(loginData == null) { //set groupLogInError to View.VISIBLE, all others to GONE } else { //set groupLogInSuccess to View.VISIBLE, all others to GONE and pause for a few seconds to allow user to see "Sign In Successful!" message } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload