How can I pass findViewById
as parameter?
I would like create method:
public void makeText() {
String random = randomize(); //example...
TextView textView = (TextView) findViewById(R.id.textView);
textView.setText(randomText);
}
But of course this method don't have function findViewById
. Method makeText
is outside Activity
and Fragment
classes.