I am currently working on a simple hang man application as my first experience in Android dev. I am having a little problem taking in the user's guessed word. My current approach is for the user to enter their guess in an EditText field and then press a button that assigns it to a variable called userGuess. Here is the relevant part:
public void onClick(View view){
EditText word;
TextView myTxt = (TextView) findViewById(R.id.display_word);
word = (EditText) findViewById(R.id.letter_guessed);
userGuess = word.toString();
System.out.println(userGuess);
}
However, when I print its value, I am greeted with the following:
System.out﹕ android.widget.EditText{23b92b5a VFED..CL .F...... 48,1064-213,1188 #7f080042 app:id/letter_guessed}
I believe that my problem lies in the casting of the word and am not sure if I am taking the correct approach.