当前位置:网站首页>Fragment addition failed error lookup
Fragment addition failed error lookup
2022-07-05 05:15:00 【ximen502_】
Find the reason according to the source code
Caused by: java.lang.IllegalArgumentException: No view found for id 0x7f0801a1 (com.exam.starseat:id/fl_out) for fragment StarFragment{
92bd796 (d41094b9-f8de-4eb5-9064-e75ab80d61b7) id=0x7f0801a1}
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:875)
at androidx.fragment.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManagerImpl.java:1238)
at androidx.fragment.app.FragmentManagerImpl.moveToState(FragmentManagerImpl.java:1303)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:439)
at androidx.fragment.app.FragmentManagerImpl.executeOps(FragmentManagerImpl.java:2079)
at androidx.fragment.app.FragmentManagerImpl.executeOpsTogether(FragmentManagerImpl.java:1869)
at androidx.fragment.app.FragmentManagerImpl.removeRedundantOperationsAndExecute(FragmentManagerImpl.java:1824)
at androidx.fragment.app.FragmentManagerImpl.execPendingActions(FragmentManagerImpl.java:1727)
at androidx.fragment.app.FragmentManagerImpl.dispatchStateChange(FragmentManagerImpl.java:2663)
at androidx.fragment.app.FragmentManagerImpl.dispatchActivityCreated(FragmentManagerImpl.java:2613)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:246)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:542)
at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:210)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1334)
at android.app.Activity.performStart(Activity.java:7067)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2819)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2931)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1620)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6701)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:249)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
fragment Add failure Class inheritance relation
onFindViewById In the end in FragmentActivity To implement inside ,activity The implementation is as follows : Called fragmentActivity Self findViewById(int id) Method , This method is in the parent class Activity Is implemented as follows :
Method call again Window In abstract classes ,Window The implementation is as follows
If you use a not activity In the layout ViewGroup(FrameLayout) Add Fragment It's a mistake to report when you're in trouble , The crash error is shown at the beginning of the article .
Reference blog :https://blog.csdn.net/hwliu51/article/details/69841068#t0
Slightly rough typesetting
边栏推荐
猜你喜欢
随机推荐
Unity get component
2022/7/1 learning summary
C4D simple cloth (version above R21)
win下一键生成当日的时间戳文件
Out and ref functions of unity
Ue4/ue5 illusory engine, material part (III), material optimization at different distances
Common technologies of unity
3dsmax scanning function point connection drawing connection line
嵌入式数据库开发编程(零)
Judge the position of the monster in the role under unity3d
LeetCode之單詞搜索(回溯法求解)
China needle coke industry development research and investment value report (2022 Edition)
[leetcode] integer inversion [7]
Unity enables mobile phone vibration
Time format conversion
Unity and database
Solon 框架如何方便获取每个请求的响应时间?
2020-10-27
Optimization scheme of win10 virtual machine cluster
3dsmax common commands