commit d38a302b8077bf6b973e36b1d096e3f48b12327b
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Sat Dec 18 21:46:22 2021 +0100

    Crash fix. Also a fix for the fact that if we started solving, went out of the app, and resumed solving - the record wasn't remembered.

diff --git a/src/main/java/org/distorted/main/RubikObjectLibInterface.java b/src/main/java/org/distorted/main/RubikObjectLibInterface.java
index 8068f8d2..8bdd8854 100644
--- a/src/main/java/org/distorted/main/RubikObjectLibInterface.java
+++ b/src/main/java/org/distorted/main/RubikObjectLibInterface.java
@@ -79,7 +79,7 @@ public class RubikObjectLibInterface implements ObjectLibInterface
 
     if( BuildConfig.DEBUG )
        {
-       android.util.Log.d("pre", msg);
+       android.util.Log.d("libInterface", msg);
        }
     else
       {
@@ -104,14 +104,15 @@ public class RubikObjectLibInterface implements ObjectLibInterface
     int level   = play.getLevel();
     String name = scores.getName();
     RubikObject obj = RubikObjectList.getObject(object);
+    String objName = obj==null ? "NULL" : obj.getName();
 
-    String record = obj+" level "+level+" time "+mNewRecord+" isNew: "+mIsNewRecord+" scrambleNum: "+scrambleNum;
+    String record = objName+" level "+level+" time "+mNewRecord+" isNew: "+mIsNewRecord+" scrambleNum: "+scrambleNum;
 
     if( BuildConfig.DEBUG )
        {
-       android.util.Log.e("pre", debug);
-       android.util.Log.e("pre", name);
-       android.util.Log.e("pre", record);
+       android.util.Log.e("libInterface", debug);
+       android.util.Log.e("libInterface", name);
+       android.util.Log.e("libInterface", record);
        }
     else
       {
@@ -316,8 +317,6 @@ public class RubikObjectLibInterface implements ObjectLibInterface
       else
         {
         mIsNewRecord = true;
-        RubikScreenPlay play= (RubikScreenPlay) ScreenList.PLAY.getScreenClass();
-        play.adjustSolvedIcons();
         }
       }
     }
@@ -335,7 +334,7 @@ public class RubikObjectLibInterface implements ObjectLibInterface
     {
     if( BuildConfig.DEBUG )
       {
-      android.util.Log.e("interface", problem);
+      android.util.Log.e("libInterface", problem);
       }
     else
       {
@@ -362,7 +361,7 @@ public class RubikObjectLibInterface implements ObjectLibInterface
 
     if( BuildConfig.DEBUG )
        {
-       android.util.Log.e("D", error);
+       android.util.Log.e("libInterface", error);
        }
     else
       {
@@ -382,7 +381,7 @@ public class RubikObjectLibInterface implements ObjectLibInterface
 
     if( BuildConfig.DEBUG )
        {
-       android.util.Log.e("D", error);
+       android.util.Log.e("libInterface", error);
        }
     else
       {
@@ -402,7 +401,7 @@ public class RubikObjectLibInterface implements ObjectLibInterface
 
     if( BuildConfig.DEBUG )
        {
-       android.util.Log.e("D", error);
+       android.util.Log.e("libInterface", error);
        }
     else
       {
diff --git a/src/main/java/org/distorted/screens/RubikScreenPlay.java b/src/main/java/org/distorted/screens/RubikScreenPlay.java
index 0599d575..b3771e0c 100644
--- a/src/main/java/org/distorted/screens/RubikScreenPlay.java
+++ b/src/main/java/org/distorted/screens/RubikScreenPlay.java
@@ -172,6 +172,7 @@ public class RubikScreenPlay extends RubikScreenBase
 
         if( act.getControl().isUINotBlocked())
           {
+          adjustSolvedIcons();
           float height= act.getScreenHeightInPixels();
           final int maxHeight= (int)(0.9f*(height-mUpperBarHeight) );
           View popupView = mPlayPopup.getContentView();
@@ -479,6 +480,8 @@ public class RubikScreenPlay extends RubikScreenBase
 
   public void savePreferences(SharedPreferences.Editor editor)
     {
+    editor.putInt("play_LevelValue", mLevelValue );
+
     if( mObjectPopup!=null )
       {
       mObjectPopup.dismiss();
@@ -502,7 +505,7 @@ public class RubikScreenPlay extends RubikScreenBase
 
   public void restorePreferences(SharedPreferences preferences)
     {
-
+    mLevelValue = preferences.getInt("play_LevelValue", 0);
     }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -559,7 +562,7 @@ public class RubikScreenPlay extends RubikScreenBase
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-  public void adjustSolvedIcons()
+  private void adjustSolvedIcons()
     {
     if( mPlayLayout!=null )
       {
