final LinearLayout ll=new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);
scrl.addView(ll);
Button add_btn=new Button(this);
add_btn.setText("Click to add TextViiews and EditTexts");
ll.addView(add_btn);
add_btn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
//String str;
TextView tv=(TextView)findViewById(R.id.tv1);
EditText et2=new EditText(getApplicationContext());
String s=et2.getText().toString();
tv.setText(s);
ll.addView(et2);
このボタンをクリックするとボタンを作成しました。値を入力すると動的に編集テキストが表示されます。値を表示する必要があります。値を表示する方法がわからないので、入力した値を動的に追加したい場合はそれを利用します。編集テキストを作成しました。