diff --git a/app/src/main/java/com/maning/gankmm/app/MyApplication.java b/app/src/main/java/com/maning/gankmm/app/MyApplication.java index 64c74bd..d3ef7b2 100644 --- a/app/src/main/java/com/maning/gankmm/app/MyApplication.java +++ b/app/src/main/java/com/maning/gankmm/app/MyApplication.java @@ -47,6 +47,11 @@ public class MyApplication extends Application { public void onCreate() { super.onCreate(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder(); + StrictMode.setVmPolicy(builder.build()); + } + initBase(); //Jpush diff --git a/app/src/main/java/com/maning/gankmm/utils/InstallUtils.java b/app/src/main/java/com/maning/gankmm/utils/InstallUtils.java index 08460f2..1f6fda2 100644 --- a/app/src/main/java/com/maning/gankmm/utils/InstallUtils.java +++ b/app/src/main/java/com/maning/gankmm/utils/InstallUtils.java @@ -181,8 +181,6 @@ public static void installAPK(Context context, String filePath) { intent.setDataAndType(Uri.parse("file://" + filePath), "application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); context.startActivity(intent); - //关闭旧版本的应用程序的进程 - android.os.Process.killProcess(android.os.Process.myPid()); } }