Android sharedpreferences.getBoolean() returns the wrong, default value
<p><a href="https://i.stack.imgur.com/iwn7v.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/iwn7v.jpg" alt="enter image description here"></a></p>

<p>On the picture you can see that the boolean variable took the default value, even though there was a key-value pair in the <code>SharedPreferences</code> with the right key. What can cause this? In the code this is at the end of an <code>onCreate</code> method. After this the <code>onMapReady</code> method gets called (from <code>com.google.android.gms.maps.OnMapReadyCallback</code>), where I check the SAME boolean value, to see If i have to place some markers on the map or not. In that method the <code>getBoolean()</code> behaviour is correct, the default value is ignored. This doesn't make any sense to me, anyone can help me out?</p>