StefMa
Dauergast
- 450
Hi,
ich lese eine Datenbank aus, wieviele Buttons (in einem array) erstellt werden.
Danach möchte ich die erstellen Buttons auf ein LinearLayout packen. (+ listener)..
Allerdings werden die Buttons ÜBERhAUPT nicht angezeigt..
Layout:
dann der Quelltext dazu:
MfG Ice
ich lese eine Datenbank aus, wieviele Buttons (in einem array) erstellt werden.
Danach möchte ich die erstellen Buttons auf ein LinearLayout packen. (+ listener)..
Allerdings werden die Buttons ÜBERhAUPT nicht angezeigt..
Layout:
...
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="72dip">
<LinearLayout
android:id="@+id/favoriten_layout"
androidrientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal">
</LinearLayout>
</ScrollView>
...
dann der Quelltext dazu:
LinearLayout ll = (LinearLayout) findViewById(R.id.favoriten_layout);
Cursor id = myDB.rawQuery("select _id from "+ table_name + "", null);
while(id.moveToNext())
howLong = howLong + 1;
Button[] buttons = new Button[howLong];
for (int i=howLong; i==0; i--)
{
buttons = new Button(this);
buttons.setText("hallo");
ll.addView(buttons);
}
MfG Ice