Note that there are some explanatory texts on larger screens.

plurals
  1. POswitch statement is not working ("jumping around" weirdly)
    text
    copied!<p>I use some really simple switch...But it does not work. I just don't see any mistake in my switch...</p> <p>I added 3 comments to my code to show, which points are reached or not reached if I enter with <code>type == BODYSIZE</code>...</p> <p>I don't see how it can happen, that "1)" is reached and "2)" not... but debugging exactly shows me this... It just jumps to "3)" after it was at "1)"...</p> <p>I tried deleting the app from my phone, deleting the bin/gen folder and rebuilding the project, but apperently the problem really is in the code... I just don't see it...</p> <pre><code>public static void getMinMaxValuesForNumberPicker(LengthType type, IntegerHolder min1, IntegerHolder max1, IntegerHolder min2, IntegerHolder max2) { switch (type) { case BODYSIZE: // cm bzw. ft + in { // 0 - 3m (3m ~ 9.84ft) if (getCurrentLengthUnit() == LengthUnit.METER) { min1.set(0); max1.set(300); } else { min1.set(0); max1.set(10); min2.set(0); max2.set(11); // &lt;= 1) IS REACHED } return; // &lt;= 2) IS NOT REACHED } case CIRCUMFERENCE: // cm bzw. in { // 0 - 500cm (500cm ~ 196.85in) if (getCurrentLengthUnit() == LengthUnit.METER) { min1.set(0); max1.set(500); } else { min1.set(0); max1.set(200); } return; } case WRINKLE: // cm bzw. in { // 0 - 50cm (50cm ~ 19.69in) if (getCurrentLengthUnit() == LengthUnit.METER) { min1.set(0); max1.set(50); } else { min1.set(0); max1.set(20); } return; } case DISTANCE: // km + m bzw. mi + yd { // 0 - 1000km (1000km ~ 621.37mi) if (getCurrentLengthUnit() == LengthUnit.METER) { min1.set(0); max1.set(1000); min2.set(0); max2.set(999); } else { min1.set(0); max1.set(500); min2.set(0); max2.set(1759); } return; // &lt;= 3) IS REACHED } default: throw new RuntimeException("getMinMaxValuesForNumberPicker für " + type.name() + " nicht implementiert!"); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload