Question

I'm a beginner android programmer, and I'm trying to figure out how to work with SwipeyTabs. First of all, is this a good way to find the view:

rb2 = (RadioButton) getView().findViewById(R.id.rb2); rb2.setOnClickListener(this);

My second question is about how to set the visibility of a TextView or an EditText with SwipeyTabs. I've made a simple application without SwipeyTabs, and there I use the code:

tvPlayer1.setVisibility(View.GONE);

Once I use this same line of code within SwipeyTabs, it crashes. Can someone explain me why I can't get this to work?

Thank you in advance!

Was it helpful?

Solution

Turned out I had a grammar mistake in my line of code.

etPlayer1 = (TextView) getView().findViewById(R.id.etPlayer1);

had to be:

etPlayer1 = (EditText) getView().findViewById(R.id.etPlayer1);

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top