Why doesn't it work? "First" overlapped "Second". What's wrong?
protected View onCreateDialogView() {
RelativeLayout layout = new RelativeLayout(mContext);
RelativeLayout.LayoutParams mParams = new RelativeLayout.LayoutParams (LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
mFirstText = new TextView(mContext);
mSecondText.setId(1);
mSecondText = new TextView(mContext);
mSecondText.setId(2);
mParams.addRule(RelativeLayout.ALIGN_PARENT_LEFT, mFirstText.getId());
mParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, mSecondText.getId());
setText(mFirstText, "First");
setText(mSecondText, "Second");
layout.addView(mFirstText, mParams);
layout.addView(mSecondText, mParams);
return layout;
}