mac
2024-01-02 d1ebb94e1a17b7c25d4fcf73d85345d92cc86b5c
app/src/main/java/com/hdl/photovoltaic/base/BaseActivity.java
@@ -1,6 +1,7 @@
package com.hdl.photovoltaic.base;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
@@ -9,6 +10,7 @@
import androidx.appcompat.app.AppCompatActivity;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.listener.BaseView;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.utils.AppManagerUtils;
@@ -26,10 +28,11 @@
    private LoadingDialog loadingDialog;
    protected Activity _mActivity;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        LocalManageUtil.changeAppLanguage("en", this);
        _mActivity = this;
        Object content = getContentView();
        //添加Activity到堆栈
@@ -44,6 +47,14 @@
        onBindView(savedInstanceState);
        //注册EventBus
        registerEventBus();
    }
    @Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(newBase);
        //app中英文设置
        LocalManageUtil.changeAppLanguage(UserConfigManage.getInstance().getCurrentAppLanguage(), newBase);
    }
@@ -96,10 +107,10 @@
        super.onDestroy();
        //隐藏Loading
        hideLoading();
        //注销EventBus
        unregisterEventBus();
        //移除Activity
        AppManagerUtils.getAppManager().removeActivity(this);
        //注销EventBus
        unregisterEventBus();
    }