[3.2.0]fix bug of multi process cause the exception
This commit is contained in:
@@ -12,6 +12,7 @@ import androidx.annotation.Nullable;
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import com.mogo.eagle.core.utilcode.util.BarUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.ProcessUtils;
|
||||
import com.mogo.eagle.core.utilcode.util.SoftKeyBoardJobber;
|
||||
|
||||
import me.jessyan.autosize.AutoSizeCompat;
|
||||
@@ -34,6 +35,9 @@ public abstract class MvpActivity<V extends IView, P extends Presenter<V>> exten
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
|
||||
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
super.onCreate(savedInstanceState);
|
||||
if (!ProcessUtils.isMainProcess(this)) {
|
||||
return;
|
||||
}
|
||||
setContentView(getLayoutId());
|
||||
initViews();
|
||||
mPresenter = createPresenter();
|
||||
@@ -112,7 +116,7 @@ public abstract class MvpActivity<V extends IView, P extends Presenter<V>> exten
|
||||
|
||||
@Override
|
||||
public Resources getResources() {
|
||||
if ( Looper.myLooper() == Looper.getMainLooper()) {
|
||||
if (Looper.myLooper() == Looper.getMainLooper()) {
|
||||
AutoSizeCompat.autoConvertDensityOfGlobal(super.getResources());
|
||||
}
|
||||
return super.getResources();
|
||||
|
||||
Reference in New Issue
Block a user