So, suppose I have an array x:
String x[][] = {
{"First item", "meti tsriF"},
{"Second", "dnoceS"},
//ect. ect.
};
And I have two TextViews in my .xml file, alpha and beta.
In my method is as follows:
public void Liszt(){
TextView beta = (TextView) findViewById(R.id.beta);
TextView alpha = (TextView) findViewById(R.id.alpha);
alpha.setTextSize(22);
beta.setTextSize(22);
for(int t=0;t<x.length;t++) {
alpha.append(x[t][1] + "\n");
}
for(int t=0;t<x.length;t++) {
beta.append(x[t][1] + "\n");
}
This method is located in the "MainActivity" class and the .xml file is displayed when I call upon its fragment. So, how could I call this method when I call the fragment? Could I just add "MainActivity.Liszt()" in the "onCreate" method?