so I know the onClick part is quite useless, but just in case it does change anything, ive put it there. so ive got the onClick, and I would like it to add the editText to the current activity, which is called activity_calculation. I currently have this code which I got from another question :
public void addCalc(View view){
EditText myEditText = new EditText(context); // Pass it an Activity or Context
myEditText.setLayoutParams(new LinearLayoutCompat.LayoutParams(MATCH_PARENT,WRAP_CONTENT)); // Pass two args; must be LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT, or an integer pixel value.
activity_calculation.addView(myEditText);
}
any help would be appreciated. maybe you can see what ive done wrong