Androidは指定されたLinearLayoutにBUTTONを動的に追加し、スタイルを設定します


LinearLayout layout = new LinearLayout(this);
                layout.setOrientation(LinearLayout.VERTICAL);
                ViewGroup.LayoutParams lp2 = new ViewGroup.LayoutParams(
                        ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);//    
                layout.setLayoutParams(lp2);
                Button btn = new Button(this);
                btn.setText(str);
                btn.setBackgroundResource(R.drawable.btn_orange_normal_shape);
                btn.setTextColor(getResources().getColor(R.color.white));
                layout.setPadding(0,10,0,0);
                layout.addView(btn);
                ll_layout.addView(layout);