I
iboshido
Neues Mitglied
- 0
hey leute, ich habe ein problem. Undzwar verstehe ich nicht wieso ich eine Linearlayout layout2 zu einem anderen Linearlayout hinzufügen kann mit "addView".
der Code sieht so aus, app stürtzt aber immer ab:
der Code sieht so aus, app stürtzt aber immer ab:
Code:
final LinearLayout layout1= new LinearLayout(this);
layout1.setLayoutParams(new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.FILL_PARENT));
layout1.setOrientation(0);//0 is horizantal
layout1.setBackgroundColor(Color.TRANSPARENT);
LinearLayout layout2= (LinearLayout) findViewById(R.id.layout_id);
layout1.addView(layout2);