I'am trying to add an Dynamicly created Button to an pre-defined (xml) LinearLayout.
Using java Syntax Highlighting
- LinearLayout lay = (LinearLayout) findViewById(R.id.content2);
- Button but = new Button(this);
- but.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.WRAP_CONTENT));
- but.setText("Hallo");
- lay.addView(but);
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
but i get the error message : java.lang.IllegalArgumentException: Invalid LayoutParams supplied to android.widget.
LinearLayout@400b6c28.
What's wrong


