package me.jingbin.bymvvm.base;


import android.content.Context;

import androidx.multidex.MultiDexApplication;

import me.jingbin.bymvvm.http.HttpUtils;


public class RootApplication extends MultiDexApplication {

    private static Context mContext;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = this;
        HttpUtils.getInstance().init(this);
    }

    public static Context getContext() {
        return mContext;
    }
}

@@ -46,25 +46,148 @@
 oid.
-content.Context;%0A
+app.Application;%0Aimport android.content.Context;%0Aimport android.os.Build;%0Aimport android.webkit.WebView;%0A%0Aimport androidx.multidex.MultiDex;
 %0Aimp
@@ -310,24 +310,16 @@
 extends 
-MultiDex
 Applicat
@@ -579,11 +579,834 @@
 t;%0A    %7D
+%0A%0A    /**%0A     * %E6%96%B9%E6%B3%95%E6%95%B0%E8%B6%8564k %E8%A7%A3%E5%86%B3 https://developer.android.com/studio/build/multidex?hl=zh-cn%0A     * %E7%BB%A7%E6%89%BF MultiDexApplication %E6%88%96 %E5%AE%9E%E7%8E%B0%E6%AD%A4%E6%96%B9%E6%B3%95%E3%80%82%0A     */%0A    @Override%0A    protected void attachBaseContext(Context base) %7B%0A        super.attachBaseContext(base);%0A        initWebView();%0A        MultiDex.install(this);%0A    %7D%0A%0A    /**%0A     * Android P%E9%92%88%E5%AF%B9 WebView%E5%9C%A8%E4%B8%8D%E5%90%8C%E8%BF%9B%E7%A8%8B%E4%B8%8B%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E9%9D%9E%E8%87%AA%E5%B7%B1%E8%BF%9B%E7%A8%8B%E4%B8%AD%E7%9A%84webview%E7%9B%AE%E5%BD%95%0A     * fix Using WebView from more than one process at once with the same data directory is not supported%0A     */%0A    private void initWebView() %7B%0A        if (Build.VERSION.SDK_INT %3E= Build.VERSION_CODES.P) %7B%0A            String processName = getProcessName();%0A            String packageName = this.getPackageName();%0A            if (!packageName.equals(processName)) %7B%0A                WebView.setDataDirectorySuffix(processName);%0A            %7D%0A        %7D%0A    %7D
 %0A%7D%0A

update handle WebView.setDataDirectorySuffix(processName)