无法为最终变量赋值 'paramView'

Cannot assign a value to final variable 'paramView'

我在 Android Studio 中遇到错误。我的 paramView 是红色的,我不知道为什么这是我的代码:错误在大标记代码处。

    public void plusOne(final View paramView)
    {
        Object localObject;
        if (this.scoreInteger == 0)
        {
            localObject = new Timer();
            this.timerTask = new TimerTask()
            {
                public void run()
                {
                    paramView.post(new Runnable()
                    {
                        public void run()
                        {
                            ((TextView)MainActivity.this.findViewById(R.id.timer)).setText(MainActivity.this.myTimer + "");
                            MainActivity localMyActivity = MainActivity.this;
                            localMyActivity.myTimer += 1;
                        }
                    });
                }
            };
            ((Timer)localObject).schedule(this.timerTask, 0L, 10L);
        }
        this.scoreInteger += 1;
        if (this.scoreInteger < 10)
        {
            ((Button)findViewById(R.id.highScore)).setText(String.valueOf(this.scoreInteger));
            return;
        }
        this.timerTask.cancel();
        this.timerTask = null;
        **paramView = (Button)findViewById(R.id.plusOne);
        paramView.setText(String.valueOf(this.scoreInteger));**
        paramView.setVisibility(View.INVISIBLE);
        ((Button)findViewById(R.id.reset)).setVisibility(View.VISIBLE);
        ((ImageView)findViewById(R.id.imageView)).setVisibility(View.VISIBLE);
        **paramView = (TextView)findViewById(R.id.timer);**
        if (this.myTimer < this.myHighScore)
        {
            this.myHighScore = this.myTimer;
            localObject = getSharedPreferences("your_prefs", 0).edit();
            ((SharedPreferences.Editor)localObject).putInt("your_int_key", this.myHighScore);
            ((SharedPreferences.Editor)localObject).commit();
        }
        for (;;)
        {
            paramView.**setText**(this.highScoreString + String.valueOf(this.myHighScore));
            paramView.setVisibility(View.VISIBLE);
            return;
            this.myHighScore = getSharedPreferences("your_prefs", 0).getInt("your_int_key", 0);
        }
    }

请帮我解决这个问题。我无法完成该应用程序。谢谢

您在方法参数中将 paramView 声明为 final。您不能修改 final 变量(这就是为什么它实际上被称为 final 的原因)。

一旦将变量声明为 final,就无法更改它。