0

I have written a card playing app.

When I tried it on my new Kindle Fire 8 HD it played a strange card.

Debugging it on the PC it played the correct card. Ditto on the emulator, on an old Kindle Fire, and a small smartphone I have.

By using Toast messages I isolated it to a variable being set to zero.

By using divide by the variable statements I found out where this was happening. But it happens in random places even if I re-install the app.

Thinking it might be a 64 bit problem I tried it on a couple of 64 bit phones but it works fine on them.

I have no native code. My APK doesn't even contain a lib folder.

Obviously not a "if = 0" problem as this would occur an all machines.

Any ideas?

Here are the only statements that reference the variable.

double endWeight;

endWeight = 1;


if ((gameType.equals("N") && (score[1] + threeForKrib + handscore(1,false) > 120))
                || (gameType.equals("Q") && (score[1] + threeForKrib + handscore(1,false) > 60)))            
    endWeight = 20;

ss -= ls * yourReplyWeight * outBias * endWeight;
Barry
  • 53
  • 6
  • Have created an app with latest AndroidStudio and gradle which is just a button whose onClick method calls the problematic method. Same error occurs on the Fire only (but is OK when button clicked again). – Barry Sep 28 '21 at 12:35
  • If I comment out the if statement it works fine although the condition is never met in this case and the endWeight = 20; statement is never performed. If I change it to = 1 there is also no problem. – Barry Oct 02 '21 at 00:09
  • If I set it to 20 instead in the second statement then no error occurs. It only happens if I change the value within an if statement whether the if condition is met or not. – Barry Oct 02 '21 at 00:37

0 Answers0