Skip to content

点击侧边栏 item 的设置报空指针 #46

@1040087877

Description

@1040087877

if(fragment!=null){
if(currentFragment==null || !currentFragment.getClass().getName().equals(fragment.getClass().getName()) )
{
getSupportFragmentManager().beginTransaction().replace(R.id.fragment_container,fragment)
.commit();
currentFragment=fragment;
}
}

判断加个fragment!=null 非空判断防止空指针

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions