So in the 15th tutorial we are making a button and a text box right? well my redButton and Username code is getting an error that states 'error can not resolve variable' can someone please tell me how to fix this error? I will post my code below. all the errors will be highlighted in red.

import android.graphics.Color;
import android.graphics.drawable.LayerDrawable;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RelativeLayout;

public class MainActivity extends AppCompatActivity {

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

//Relative layout thing

RelativeLayout ayrtonsLayout = new RelativeLayout(this);
ayrtonsLayout.setBackgroundColor(Color.GREEN);
//button location

RelativeLayout.LayoutParams buttonDetails = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
);
//text box location

RelativeLayout.LayoutParams UsernameDetails = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.WRAP_CONTENT,
RelativeLayout.LayoutParams.WRAP_CONTENT
);
//User name location details

UsernameDetails.addRule(RelativeLayout.ABOVE, redButton.getId(1));
UsernameDetails.addRule(RelativeLayout.CENTER_HORIZONTAL);
UsernameDetails.addMargins(0, 0, 0, 50);

//Button location details
buttonDetails.addRule( RelativeLayout.CENTER_HORIZONTAL);
buttonDetails.addRule(RelativeLayout.CENTER_VERTICAL);

//Id's
redButton.setId(1);
Username.setId(2);

//Methods
EditText Username = new EditText(this);
Button redButton = new Button (this);

//Button property's
redButton.setText("Log on");
redButton.setBackgroundColor(Color.RED);

//Make stuff show
ayrtonsLayout.addView(redButton, buttonDetails);
ayrtonsLayout.addView(Username, UsernameDetails);
setContentView(ayrtonsLayout);

}
}

I have no clue what's wrong and i would love if someone would tell me so i can fix this in the future.