The local variable xxx is never read

后端 未结 6 1647
不思量自难忘°
不思量自难忘° 2021-01-29 13:24

This is my code:

boolean startGameBoolean;
Bundle extras = getIntent().getExtras();
extras.getInt(\"startGameBoolean\");
if (startGameBoolean = true){
    counte         


        
6条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-29 13:54

    I would venture to agree with Eclipse, it's not being used. The code you've show us doesn't have it being used anywhere.

    Update

    The variable is still never used because you assign it in your if condition; you never compare it (which is what it looks like you're trying to do).

    Change

    if (startGameBoolean = true){
    

    to

    if (startGameBoolean){
    

提交回复
热议问题