This is my code:
boolean startGameBoolean;
Bundle extras = getIntent().getExtras();
extras.getInt(\"startGameBoolean\");
if (startGameBoolean = true){
counte
Shouldn't it be startGameBoolean = extras.getBoolean("startGameBoolean");
?
in the code you gave, boolean startGameBoolean;
is not used anywhere. the warning means that although you declared it, it is not used in the block where it lives, therefore could (should) be removed.
Edit:
After seeing your addition, you use startGameBoolean
, but you assign to it, while you should compare to it:
if (startGameBoolean == true){
// ^
counter.start();
}
Also, assign the result of getBoolean()
to the variable as I wrote in the first statement.