Error inflating class fragment

后端 未结 30 2186
长发绾君心
长发绾君心 2020-11-22 14:38

I get the Error

Unable to start activity ComponentInfo{de.androidbuch.activiti/de.androidbuch.activiti.task.Activity}: android.view.InflateException: Binar         


        
30条回答
  •  伪装坚强ぢ
    2020-11-22 15:07

    If you want to inherit the AppCompatActivity, then you can do something like this- In the activity xml, use a FrameLayout like this-

    
    

    and in the activity onCreate-

    final FragmentManager supportFragmentManager = getSupportFragmentManager();
        FragmentTransaction ft = supportFragmentManager.beginTransaction();
        ft.replace(R.id.result_fragment, fphResultActivityFragment, "result fragment");
        ft.commitAllowingStateLoss();
    

提交回复
热议问题