点击其他按钮不扣分

The score is not deducted when other button is clicked

在我的应用中,如果用户猜对了答案,就会给10分,然后加到newCoin,然后newCoin的值会传给下一个Activity使用 Intent

每个问题包含 3 个帮助。 当用户点击help1时,分数必须被扣除10。如果用户点击help2,则分数再次被扣除10(help3也是如此)

当我点击任何帮助(help1/help2/help3)时,newCoin被扣除10。但是当我点击另一个帮助时,当前硬币没有被扣除。好像是什么问题?

这是我的代码

int scoreText;
int newScore, newCoin=0;

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.luzon2);

    Intent intent=getIntent();
    int myValue=intent.getIntExtra("parameter name2", 0);
    final int newCoin=myValue;
    scoreTxt=(TextView)findViewById(R.id.score);
    scoreTxt.setText("" + newCoin);

    luz2he1=(Button)findViewById(R.id.btnLuz1);
    luz2he1.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        if (newCoin>=10){
            newScore=(newCoin-10);
            scoreTxt.setText("" + newScore); 
        } 
    } });

    luz2he2=(Button)findViewById(R.id.btnLuz2);
    luz2he2.setOnClickListener(new OnClickListener() {
    @Override
    public void onClick(View v) {
        if (newCoin>=10){
            newScore=(newCoin-10);
            scoreTxt.setText("" + newScore); 
        } 
    } });

   luz2he3=(Button)findViewById(R.id.btnLuz3);
   luz2he3.setOnClickListener(new OnClickListener() {
   @Override
   public void onClick(View v) {
       if (newCoin>=10){
           newScore=(newCoin-10);
           scoreTxt.setText("" + newScore); 
       } 
   } });}

更新所有帮助方法中的 'newCoin' 值。

 public void onClick(View v) {
             if (newCoin>=10){
                 newCoin -= 10;        
                 newScore = newCoin;