I have declared the method showTotalPoints(), but when it is called upon further down the code, Android Studio says it is a variable, not a method. It is indeed not in orange font (color for methods) but in grey font (color for unused variables). And a method that is being called should be in white font. Here it is in purple font, which again implies a variable.
Hovering the cursor over the code, the pop-up also confirms its a variable, not a method. I have declared (not shown, somewhere else in the code) another method calculateValues(), and that is properly interpreted as a method within the same curly braces.
Can someone please advise me on where I did a coding error?
public void showTotalPoints(){
textviewtpA.setText(String.valueOf(tpA));
textviewtpB.setText(String.valueOf(tpB));
}
buttonWinnerA.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
winnersA = changeScore(winnersA, entry.isChecked());
calculateValues();
buttonWinnerA.setText(getString(R.string.winnner) + " (" +
String.valueOf(winnersA) + ")");
showTotalPoints();
}
});