TextView not clickable?


#1

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) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_quiz);

	mQuestionTextView = (TextView)findViewById(R.id.question_text_view);
	mQuestionTextView.setOnClickListener(new View.OnClickListener() {
		
		@Override
		public void onClick(View v) {
			mCurrentIndex = (mCurrentIndex + 1) % mQuestionBank.length;
			updateQuestion();				
		}
	});
	
	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?


#2

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…


#3

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