could any one help ? I have problem and i cant solve it    when i add redButton .getID()  show me error !

//Layout
        RelativeLayout abdul = new RelativeLayout (this);
        //Button
        Button redBbutton= new Button(this);
        //EditText
        EditText username= new EditText(this);
        
        abdul.setBackgroundColor(Color.BLUE);
        RelativeLayout.LayoutParams buttonDetails= new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT
        );
      
        RelativeLayout.LayoutParams usernameDetails= new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.WRAP_CONTENT,
                RelativeLayout.LayoutParams.WRAP_CONTENT
        );
        usernameDetails.addRule(RelativeLayout.ABOVE, redButton.getId());

        usernameDetails.addRule(RelativeLayout.CENTER_HORIZONTAL);
        buttonDetails.addRule(RelativeLayout.CENTER_HORIZONTAL);
        buttonDetails.addRule(RelativeLayout.CENTER_VERTICAL);
        usernameDetails.setMargins(0,0,0,50);
        
        abdul.addView(username);
     username.setBackgroundColor(Color.GRAY);
        
  
        redBbutton.setBackgroundColor(Color.RED);
        redBbutton.setText("CLICK HERE");
        abdul.addView(redBbutton,buttonDetails);
        setContentView(abdul);
        redBbutton.setId(1);
        username.setId(2);