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,11 +10,13 @@
import androidx.appcompat.app.AppCompatActivity;
import com.hdl.photovoltaic.R;
import com.hdl.photovoltaic.bean.BaseEventBus;
import com.hdl.photovoltaic.config.UserConfigManage;
import com.hdl.photovoltaic.listener.BaseView;
import com.hdl.photovoltaic.other.HdlThreadLogic;
import com.hdl.photovoltaic.utils.AppManagerUtils;
import com.hdl.photovoltaic.utils.LocalManageUtil;
import com.hdl.photovoltaic.widget.LoadingDialog;
import com.hdl.sdk.link.core.bean.eventbus.BaseEventBus;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
@@ -24,6 +27,7 @@
    private LoadingDialog loadingDialog;
    protected Activity _mActivity;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
@@ -43,6 +47,14 @@
        onBindView(savedInstanceState);
        //注册EventBus
        registerEventBus();
    }
    @Override
    protected void attachBaseContext(Context newBase) {
        super.attachBaseContext(newBase);
        //app中英文设置
        LocalManageUtil.changeAppLanguage(UserConfigManage.getInstance().getCurrentAppLanguage(), newBase);
    }
@@ -95,6 +107,8 @@
        super.onDestroy();
        //隐藏Loading
        hideLoading();
        //移除Activity
        AppManagerUtils.getAppManager().removeActivity(this);
        //注销EventBus
        unregisterEventBus();