TextView not clickable?


I’m having some trouble with the first challenge at the end of this chapter, adding a listener to the TextView in GeoQuiz. I’ve added the listener like this:

[ul]protected void onCreate(Bundle savedInstanceState) {

	mQuestionTextView = (TextView)findViewById(R.id.question_text_view);
	mQuestionTextView.setOnClickListener(new View.OnClickListener() {
		public void onClick(View v) {
			mCurrentIndex = (mCurrentIndex + 1) % mQuestionBank.length;
	mTrueButton = (Button)findViewById(R.id.true_button);[/ul]

When I run the app, nothing happens when I click on the TextView - no indication a click has been made and no change in the text displayed. Obviously, I’m missing something very simple. Any hints?


Never mind - silly operator error on my part with Eclipse; turns out I was editing the wrong copy of the relevant file. All is well now, except for my embarrassment…


Don’t be too embarrassed. I think I did the exact same thing you did.