Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMUZ140820 Immaculate Ncube
4,611 PointsIn the onCreate() method, add the line of code that requests the progress indicator window feature. Here's some helpful
i need help
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import com.parse.ParseUser;
import com.parse.ParseException;
import com.parse.SignUpCallback;
public class SignUpActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// rest of code omitted
}
protected void signUp(String username, String password) {
ParseUser newUser = new ParseUser();
newUser.setUsername(username);
newUser.setPassword(password);
newUser.signUpInBackground(new SignUpCallback() {
@Override
public void done(ParseException e) {
// some code omitted
}
});
}
}
2 Answers
Steve Hunter
57,712 PointsAdd this line in onCreate()
:
requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
Chris Wolchesky
12,025 PointsYou need to inform the system you would like to use the Progress Bar feature using requestWindowFeature(). The argument is a static member of the Window class, i.e. requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS).