gpt4 book ai didi

android - 在 FrameLayout 中替换时,Google map 因 Resources$NotFoundException 而崩溃

转载 作者:行者123 更新时间:2023-12-04 23:37:40 24 4
gpt4 key购买 nike

这就是我在 FrameLayout 中动态添加 map 的方式。

new Handler().postDelayed(() -> {
if (isAdded()) {
new Thread(() -> {
try {
SupportMapFragment mf = SupportMapFragment.newInstance();
getChildFragmentManager().beginTransaction()
.replace(R.id.view_map, mf)
.commit();
mActivity.runOnUiThread(() -> mf.getMapAsync(this));
} catch (Exception ignored) {}
}).start();
}
}, 100);

它工作正常,但在某些情况下,应用程序因 Resources$NotFoundException 而崩溃.这是崩溃日志。
android.content.res.Resources$NotFoundException: Resource ID #0x7f07000f
at android.content.res.Resources.getValue(Resources.java: 1266)
at android.content.res.Resources.getDimensionPixelSize(Resources.java: 673)
at maps.ad.ay. < init > (Unknown Source)
at maps.ad.ay. < init > (Unknown Source)
at maps.ad.t.a(Unknown Source)
at maps.ad.M.a(Unknown Source)
at wd.onTransact(: com.google.android.gms.DynamiteModulesB: 107)
at android.os.Binder.transact(Binder.java: 380)
at com.google.android.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateView(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zza.onCreateView(Unknown Source)
at com.google.android.gms.dynamic.zza$4.zzb(Unknown Source)
at com.google.android.gms.dynamic.zza.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.onCreateView(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
at android.support.v4.app.Fragment.performCreateView(Fragment.java: 2080)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java: 1108)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java: 1290)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java: 801)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java: 1677)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java: 536)
at android.os.Handler.handleCallback(Handler.java: 746)
at android.os.Handler.dispatchMessage(Handler.java: 95)
at android.os.Looper.loop(Looper.java: 135)
at android.app.ActivityThread.main(ActivityThread.java: 5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java: 372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java: 907)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java: 702)

最佳答案

该错误一直随机出现。
可能的解决方案here .

关于android - 在 FrameLayout 中替换时,Google map 因 Resources$NotFoundException 而崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40382082/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com