Android: Fix a possible crash when main recreates

This commit is contained in:
Connor McLaughlin 2021-02-07 03:04:37 +10:00
parent 1a63edec27
commit 3bc34d40a1
2 changed files with 5 additions and 0 deletions
android/app/src/main/java/com/github/stenzek/duckstation

View file

@ -41,6 +41,10 @@ public class AndroidHostInterface {
} }
} }
public void setContext(Context context) {
mContext = context;
}
static public native String getScmVersion(); static public native String getScmVersion();
static public native String getFullScmVersion(); static public native String getFullScmVersion();

View file

@ -175,6 +175,7 @@ public class MainActivity extends AppCompatActivity {
throw new RuntimeException("Failed to create host interface"); throw new RuntimeException("Failed to create host interface");
} }
AndroidHostInterface.getInstance().setContext(this);
mGameList.refresh(false, false, this); mGameList.refresh(false, false, this);
} }