java.lang.illegalargumentexception:找不到id为0x7f0a00ae(com.finix)的视图callme:id/floating)对于fragment dashboardfragment

deikduxw  于 2021-07-03  发布在  Java
关注(0)|答案(0)|浏览(333)

我的应用程序正在崩溃 Jmeter 板fragemt什么都没有我刚刚创建了一个空白片段公共类mainactivity扩展了appcompatactivity{chipnavigationbar chipnavigationbar;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    chipNavigationBar = findViewById(R.id.bottom_nav_menu);
    bottomMenu();
    getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,new MessageFragment()).commit();

}

private void bottomMenu() {
    chipNavigationBar.setOnItemSelectedListener(new ChipNavigationBar.OnItemSelectedListener() {
        @Override
        public void onItemSelected(int i) {
            Fragment fragment = null;
            switch (i) {

                case R.id.dashboard:
                    //fragment = new DashboardFragment();
                    break;
                case R.id.message:
                    fragment = new MessageFragment();
                    break;
                case R.id.profile:
                    fragment = new ProfileFragment();
                    break;
            }
            getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,fragment).commit();

        }
    });
}

}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题