Code example for ScrollView

Methods: setLayoutParamsaddView

0
		btnQuery.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.MATCH_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT));
		layout.addView(btnQuery);
 
		sView = new ScrollView(this);
		sView.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.MATCH_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT));
		layout.addView(sView);
		 
		txtView = new TextView(this);
		txtView.setText("取得結果をここに表示します");
		txtView.setRawInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE);
		txtView.setLayoutParams(new LinearLayout.LayoutParams(
				LinearLayout.LayoutParams.MATCH_PARENT,
				LinearLayout.LayoutParams.WRAP_CONTENT));
		sView.addView(txtView);
	} 
 
	@Override 
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.activity_test_cnt_provider, menu);