There is a method, when you click on the button, the programmatically created markup should appear, but nothing appears, what's the problem?

public void Load(){ FrameLayout frameLayout = new FrameLayout(this); LinearLayout parentLinear = new LinearLayout(this); parentLinear.setLayoutParams(new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 160, Gravity.BOTTOM)); parentLinear.setWeightSum(1f); parentLinear.setOrientation(LinearLayout.HORIZONTAL); LinearLayout linearLayoutLeft = new LinearLayout(this); linearLayoutLeft.setLayoutParams(new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 0.5f)); linearLayoutLeft.setOrientation(LinearLayout.HORIZONTAL); linearLayoutLeft.setBackgroundColor(Color.RED); LinearLayout linearLayoutRight = new LinearLayout(this); linearLayoutRight.setLayoutParams(new LinearLayout.LayoutParams(0, LinearLayout.LayoutParams.MATCH_PARENT, 0.5f)); linearLayoutRight.setOrientation(LinearLayout.HORIZONTAL); linearLayoutRight.setBackgroundColor(Color.BLUE); parentLinear.addView(linearLayoutLeft); parentLinear.addView(linearLayoutRight); frameLayout.addView(parentLinear); RelativeLayout rel = (RelativeLayout) findViewById(R.id.relative); rel.addView(frameLayout); } 
  • Zero first parameter in the constructor - for what reasons? - post_zeew
  • @post_zeew I don’t know, I don’t really understand the program markup of activation, they helped me to do it here - fcbarcafc

0