为什么当我点击一个片段放在我的内容中的图像上?

时间:2015-11-14 20:10:55

标签: android-fragments

@SuppressWarnings("StatementWithEmptyBody")
@Override
public boolean onNavigationItemSelected(MenuItem item) {'
    // Handle navigation view item clicks here.
    int id = item.getItemId();
    Fragment fragment = null;

    if (id == com.example.edwincastao_pc.app_gym.R.id.nav_search) {
        fragment = new Search_Custom();'
    } else if (id == com.example.edwincastao_pc.app_gym.R.id.nav_register) {
        fragment = new Log_In();'
    } else if (id == com.example.edwincastao_pc.app_gym.R.id.nav_delete) {
    } else if (id == com.example.edwincastao_pc.app_gym.R.id.nav_manage) {
    } else if (id == com.example.edwincastao_pc.app_gym.R.id.nav_info) {
    } else if (id == com.example.edwincastao_pc.app_gym.R.id.nav_close) {
    }
    if (fragment != null) {
        FragmentManager fragmentManager = getSupportFragmentManager();
        fragmentManager.beginTransaction().replace(R.id.contenido, fragment).commit();
    }

    DrawerLayout drawer = (DrawerLayout) findViewById(com.example.edwincastao_pc.app_gym.R.id.drawer_layout);
    drawer.closeDrawer(GravityCompat.START);
    return true;
}

0 个答案:

没有答案