このプロジェクトのために私を助けてください。この条件は、ゲーム進行のためのものです。ここでのエラーは、if ステートメントの 1 つが正しい場合です。別のボタンをキャストして正しく答えが得られた場合、結果はもう追加されません..助けてください..どうもありがとう..:DD
try
{
if(questonedone==true)
{
btl1.setBackgroundResource(R.drawable.f1);
btl1.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questtwodone==true)
{
btl2.setBackgroundResource(R.drawable.f5);
btl2.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questthreedone==true)
{
btl3.setBackgroundResource(R.drawable.f9);
btl3.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questfourdone==true)
{
btl4.setBackgroundResource(R.drawable.f13);
btl4.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questfivedone==true)
{
btl5.setBackgroundResource(R.drawable.f2);
btl5.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questsixdone==true)
{
btl6.setBackgroundResource(R.drawable.f6);
btl6.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questsevendone==true)
{
btl7.setBackgroundResource(R.drawable.f10);
btl7.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questeightdone==true)
{
btl8.setBackgroundResource(R.drawable.f14);
btl8.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questninedone==true)
{
btl9.setBackgroundResource(R.drawable.f3);
btl9.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questtendone==true)
{
btl10.setBackgroundResource(R.drawable.f7);
btl10.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questelevendone==true)
{
btl11.setBackgroundResource(R.drawable.f11);
btl11.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questtwelvedone==true)
{
btl12.setBackgroundResource(R.drawable.f15);
btl12.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questthirteendone==true)
{
btl13.setBackgroundResource(R.drawable.f4);
btl13.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questfourteendone==true)
{
btl14.setBackgroundResource(R.drawable.f8);
btl14.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questfifteendone==true)
{
btl15.setBackgroundResource(R.drawable.f12);
btl15.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
if(questsixteendone==true)
{
btl16.setBackgroundResource(R.drawable.f16);
btl16.setEnabled(false);
counter = percent + 6.25 ;
counter2 = percent2 + 1;
}
result.setText(counter + "%");
result2.setText(counter2 + " out of 16");
}
catch(Exception e)
{
}