This code helps me to load an array by clicking a button that has a tag name which is same with an array name. I know this approach is a headache because there is over 100 buttons,
private void altBasamakGetir(String kazanimNO)
{
Resources res=this.getResources();
infoTxt.setText(kazanimNO);
switch (kazanimNO)
{
case "kazanim_0":
{
String altBasamaklar[]= res.getStringArray(R.array.kazanim_0);
}
;break;
case "kazanim_1":
{
String altBasamaklar[]= res.getStringArray(R.array.kazanim_1);
}
;break;
case "kazanim_2":
{
String altBasamaklar[]= res.getStringArray(R.array.kazanim_2);
}
;break;
case "kazanim_3":
{
String altBasamaklar[]= res.getStringArray(R.array.kazanim_2);
}
;break;
}
}
String altBasamaklar[]= res.getStringArray(R.array.kazanimNo);
an easy way to engage the parameter kazanimNO to the array
I don't know how to search about this issue so I ask it here.
Thanks for any information.