The local variable xxx is never read

后端 未结 6 1651
不思量自难忘°
不思量自难忘° 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 14:01

    Bundle extras = getIntent().getExtras();
    boolean startGameBoolean = extras.getBoolean("startGameBoolean");
    

    Something like this? You cant fetch boolean with getInt(). Perhaps, if you are dealing with int but with values 0 and 1. Then you should change the type of startGameBoolean to int and fetch it with getInt(), people do this sometimes.

提交回复
热议问题