JessYanCoding / AndroidAutoSize

🔥 A low-cost Android screen adaptation solution (今日头条屏幕适配方案终极版,一个极低成本的 Android 屏幕适配方案).
Apache License 2.0
13.47k stars 1.96k forks source link

在锤子手机上 getResources() 使用崩溃 #379

Closed jswn0203 closed 2 years ago

jswn0203 commented 2 years ago

@Override public Resources getResources() { Resources res = super.getResources(); Configuration config = new Configuration(); config.setToDefaults(); config.setLocale(AppLocale.getDefault()); res.updateConfiguration(config, res.getDisplayMetrics()); AutoSizeCompat.autoConvertDensityOfGlobal(res);//如果没有自定义需求用这个方法 return res; }

再部分锤子手机上这样写会闪退,提示java.lang.illegalstateexception: not in applications main thread

JessYanCoding commented 2 years ago

https://github.com/JessYanCoding/AndroidAutoSize/issues/359