From 8b8e2aa27a6b99a282f3334ab2d3b5c40525875d Mon Sep 17 00:00:00 2001 From: maning Date: Sat, 1 Apr 2017 16:45:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=A5=E6=A0=BC=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/com/maning/gankmm/app/MyApplication.java | 5 +++++ app/src/main/java/com/maning/gankmm/utils/InstallUtils.java | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) 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()); } }