From 73119c7d3eedce5c8343d103a3e78d3f73ca7faa Mon Sep 17 00:00:00 2001 From: FENGberd Date: Tue, 5 Sep 2017 12:54:58 +0800 Subject: [PATCH 1/2] Fix some crashes. --- app/build.gradle | 4 ++-- .../pocket_server/activity/MainActivity.java | 20 +++++++++++++------ .../pocket_server/fragment/MainFragment.java | 5 ++++- .../fragment/SettingsFragment.java | 5 ++++- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 2526443..52f30f5 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "net.fengberd.minecraftpe_server" minSdkVersion 14 targetSdkVersion 21 - versionCode 1090 - versionName "1.0.9.0" + versionCode 1091 + versionName "1.0.9.1" vectorDrawables.useSupportLibrary = true } diff --git a/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java b/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java index 8186c6c..34eac4c 100644 --- a/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java +++ b/app/src/main/java/moe/berd/pocket_server/activity/MainActivity.java @@ -227,12 +227,20 @@ public void run() public void switchFragment(Fragment target,int title) { - getFragmentManager().beginTransaction() - .setCustomAnimations(R.animator.enter,R.animator.exit) - .replace(R.id.layout_main,target) - .commit(); - currentFragment=target; - setTitle(title); + try + { + getFragmentManager().beginTransaction() + .setCustomAnimations(R.animator.enter,R.animator.exit) + .replace(R.id.layout_main,target) + .commit(); + currentFragment=target; + setTitle(title); + } + catch(Exception e) + { + // commitAllowingStateLoss is danger so I prefer to crash the Exception + toast(e.toString()); + } } public void chooseFile(int code,String title) diff --git a/app/src/main/java/moe/berd/pocket_server/fragment/MainFragment.java b/app/src/main/java/moe/berd/pocket_server/fragment/MainFragment.java index 2cb3d1d..058cf57 100644 --- a/app/src/main/java/moe/berd/pocket_server/fragment/MainFragment.java +++ b/app/src/main/java/moe/berd/pocket_server/fragment/MainFragment.java @@ -138,7 +138,10 @@ public void run() { public void run() { - processing_dialog.dismiss(); + if(processing_dialog.isShowing()) + { + processing_dialog.dismiss(); + } } }); } diff --git a/app/src/main/java/moe/berd/pocket_server/fragment/SettingsFragment.java b/app/src/main/java/moe/berd/pocket_server/fragment/SettingsFragment.java index d3a8ed9..0cd6b34 100644 --- a/app/src/main/java/moe/berd/pocket_server/fragment/SettingsFragment.java +++ b/app/src/main/java/moe/berd/pocket_server/fragment/SettingsFragment.java @@ -62,7 +62,10 @@ public void run() { public void run() { - processing_dialog.dismiss(); + if(processing_dialog.isShowing()) + { + processing_dialog.dismiss(); + } } }); } From 0e6fed879ba077e90cede2aa647b20240b93377d Mon Sep 17 00:00:00 2001 From: FENGberd Date: Sat, 9 Sep 2017 13:04:17 +0800 Subject: [PATCH 2/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6aa1aeb..f6d9f4c 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ PocketMine = Install App -> Install PHP -> Check PocketMine at Server Type -> P Nukkit = Rooting -> Install App -> Install Java -> Check Nukkit at Server Type -> Press Mount Java Library(ROOT), if you use KingRoot, you check Use ku.sud in to request root in Settings -> Press Start Server -# About JRE +# About JRE (ARM ONLY,NO x86 BINARY IN CURRENT) You can get "nukkit_library.tar.gz" from Here # LICENSE