Trying in AndroidStudio to change the text (id=version) depending on whether I get true or false from settings.isPremium().
How can I realize that?
settings.isPremium() works fine, I still want to know, how to toggle the text content.
if(settings.isPremium()) {
view.findViewById(R.id.version).setText = "Premium"
}
else view.findViewById(R.id.version).setText = "NO Premium"
2
Answers
you can change the text of an view by
settext();
hear you need to use it like this.view.findViewById(R.id.version).setText("Preminum")
and use a
Log.v()
function to check if it is changed or not.Log.v(<Enter Function Name>,<Enter a string>);
Hear you can use Log.v() like this.
Log.V("Function name",String.valueof(settiings.ispreminum()));
Try this: