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 trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Error Messages with Dialogs

Please Help

I cANT GET tHIS Question Please Help Me Any Help Will Be Appreciated thanks Aryan

GuessNumberActivity.java
import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.widget.EditText;
import android.R;

public class GuessNumberActivity extends Activity {

    protected String mUserInput;
  protected EditText mNumberField;

  public void onCreate(){
    mNumberField = (EditText)findViewById(R.id.numberField);
    mUserInput = (String)findViewById(R.id.userInputField);
  }
    /*
     * onCreate() and other code has been omitted for brevity!
     */

    public void makeGuess() {
        // Set mUserInput here!        

        // Check to see if the user's number is correct
        boolean isCorrect = GuessEngine.testGuess(mUserInput);

    }
}

2 Answers

Hello,

From the state of your code, I'm going to guess you're on Task 2. My first suggestion is to get rid of the onCreate() that you wrote since there technically is one that has been hidden. All this task is doing is asking you set mUserInput to be equal the text of mNumberField when you first enter the makeGuess() method. I hope this gets you on your way to solving this Task, if not, please provide your update code and I will try to assist you further.

hi James I did it it doesnt work

Could you post the updated version of your code? It would help me in providing assistance based on where you're at currently.