| |||||||
Das Thema "ListActivity - Liste bleibt trotz Daten leer - kein Fehler!?" befindet sich unter Android App Entwicklung auf Android-Hilfe.de.
|
| | Themen-Optionen | Ansicht |
| | #1 (permalink) |
| Android-Hilfe.de Mitglied Registriert seit: 04.03.2010
Beiträge: 56
Abgegebene Danke: 1
Erhielt 2 Danke für 2 Beiträge
| ![]() Hallo zusammen, folgende Problematik: Ich möchte eine ListActivity nutzen, der Cursor enthält Datensätze, jedoch bleibt die Liste leer. Blöderweise kommt aber kein Fehler der mir helfen würde. Ich schätze mal mit dem Mapping der Daten stimmt was nicht - allerdings weiß ich nicht wie es anders gehen sollte. Die ListActivity: Code: Cursor result = db.rawQuery("SELECT _id, description...", null);
Log.d("WD", "Results: "+result.getCount()); // Ist > 0
startManagingCursor(result);
ListAdapter adapter = new SimpleCursorAdapter(
this,
R.layout.lesson_item,
result,
new String[] {"starttime", "description"},
new int[] {R.id.time, R.id.description});
setListAdapter(adapter); Code: <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ListView android:id="@id/android:list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#000000"
android:layout_weight="1"
android:drawSelectorOnTop="false"/>
<TextView android:id="@id/android:empty"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:color="#FFFFFF"
android:text="Kein Eintrag"/>
</LinearLayout> Code: <?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView android:id="@+id/time"
android:textSize="12sp"
android:textStyle="bold"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
<TextView android:id="@+id/description"
android:textSize="16sp"
android:layout_width="fill_parent"
android:layout_height="wrap_content"/>
</LinearLayout> Gruß Chris Geändert von _chris (06.03.2010 um 15:25 Uhr) |
| | |
![]() |
|
| Themen-Optionen | |
| Ansicht | |
| |
| ||||
| Thema | Autor | Forum | Antworten | Letzter Beitrag |
| Kein HSDPA-Icon trotz Netztyps? | karlcox | Tarife / Provider für Nexus One | 3 | 23.02.2010 13:06 |
| Bleibt ihr beim Milestone, trotz Nexus One? | jochenhorst | Motorola Milestone Forum | 107 | 11.02.2010 01:56 |
| Kein Internetzugriff trotz WLAN Verbindung | roboroid | Samsung Galaxy (I7500) Forum | 3 | 11.10.2009 21:03 |
| Eine immer aktuelle Liste + technische Daten von Android phones | Lubomir | Sonstige Android-Smartphones | 0 | 18.09.2009 01:47 |