No view found for id 0x7f070042 for fragment

He used a fragment, but flash back multiple times. Log information is as follows

 Caused by: java.lang.IllegalArgumentException: No view found for id 0x7f070042 (com.example.administrator.mi_home:id/fm_container) for fragment OftenUseFragment{327f2801 #0 id=0x7f070042}

Always I thought it can not find the fragment layout file, carefully over again found to be reused when adding fragment layout file.

ft.add(R.id.fg_device_detail, fragment).show(fragment); //添加fragment入栈

I used in the application of the two fragment, container id are fm_container and fg_device_detail, the former first call the code, and the code behind me is copied directly in the past, and forget to change the id of the container, so there have been errors.

After id change back, normal operating procedures

 

 

Guess you like

Origin blog.csdn.net/Smile_Qian/article/details/81509529