道路规则应用程序
我有一个活动,其中将根据票号显示问题和答案(20 个问题和 5x20 个答案)。字符串中包含的问题和答案重新排序并排序。我的代码非常糟糕,我想通过循环来简化,就像有问题 [q] 但有 2 个变量的情况一样。请帮帮我。
https://play.google.com/store/apps/details?id=ua.in.sil.cryzalit.mybilets
number = intent.getStringExtra("number");
for( int i = 1; i < 21; i++)
{
q[i]= this.getResources().getIdentifier("q"+i+"_" + number, "string", this.getPackageName());
}
int a1_1 = this.getResources().getIdentifier("a1_1_" + number, "string", this.getPackageName());
int a2_1 = this.getResources().getIdentifier("a2_1_" + number, "string", this.getPackageName());
int a3_1 = this.getResources().getIdentifier("a3_1_" + number, "string", this.getPackageName());
int a4_1 = this.getResources().getIdentifier("a4_1_" + number, "string", this.getPackageName());
int a5_1 = this.getResources().getIdentifier("a5_1_" + number, "string", this.getPackageName());
\\\\
int a1_20 = this.getResources().getIdentifier("a1_20_" + number, "string", this.getPackageName());
int a2_20 = this.getResources().getIdentifier("a2_20_" + number, "string", this.getPackageName());
int a3_20 = this.getResources().getIdentifier("a3_20_" + number, "string", this.getPackageName());
int a4_20 = this.getResources().getIdentifier("a4_20_" + number, "string", this.getPackageName());
int a5_20 = this.getResources().getIdentifier("a5_20_" + number, "string", this.getPackageName());
FFIVE
相关分类