Skip to content

Commit

Permalink
严格模式
Browse files Browse the repository at this point in the history
  • Loading branch information
maning committed Apr 1, 2017
1 parent 2bdabbb commit 8b8e2aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 5 additions & 0 deletions app/src/main/java/com/maning/gankmm/app/MyApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions app/src/main/java/com/maning/gankmm/utils/InstallUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

}

0 comments on commit 8b8e2aa

Please sign in to comment.