change activity main drawer items text color programmatically android

Java
NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);

	//items text color
    int[][] state = new int[][] {
            new int[] {-android.R.attr.state_enabled}, // disabled
            new int[] {android.R.attr.state_enabled}, // enabled
            new int[] {-android.R.attr.state_checked}, // unchecked
            new int[] { android.R.attr.state_pressed}  // pressed

    };

    int[] color = new int[] {
            Color.WHITE,
            Color.WHITE,
            Color.WHITE,
            Color.WHITE
    };

    ColorStateList colorStateList1 = new ColorStateList(state, color);


    //icons color
    int[][] states = new int[][] {
            new int[] {-android.R.attr.state_enabled}, // disabled
            new int[] {android.R.attr.state_enabled}, // enabled
            new int[] {-android.R.attr.state_checked}, // unchecked
            new int[] { android.R.attr.state_pressed}  // pressed

    };

    int[] colors = new int[] {
            Color.WHITE,
            Color.WHITE,
            Color.WHITE,
            Color.WHITE
    };
    ColorStateList colorStateList2 = new ColorStateList(states, colors);
    navigationView.setItemTextColor(colorStateList1);
    navigationView.setItemIconTintList(colorStateList2);
Source

Also in Java: