I have a textview that must be put in center of screen in relative layout.
TextView displays random question, when i select answers, new text is put in the textview.
The very first time activity runs, it stays somewhat off the center, but as i answer questions, it starts staying in the right place.
I can't use "center in parent" attr. I don't have any other params for this textview.
class M extends Activity{
@Override
public void onCreate(){
question1 = (TextView) findViewById(R.id.question1);
//this relative layout params should be applied right away! but they don't
for_question1 = new RelativeLayout.LayoutParams(600,200);
for_question1.setMargins(635, 365, 0, 0);
question1.setLayoutParams(for_question1);
question1.requestLayout();
}
}