我正在写一个简单的待办事项应用程序,并在listView上工作。继教程http://www.vogella.com/tutorials/AndroidListView/article.html#tutorial_ownadapterAndroid TodoApp与ListView - 列表不显示
我的问题是,todos列表不显示在listView中。我没有得到任何异常或错误,表明它不工作。
我正在使用android sqlite数据库。当我开始活动时,我将对象写入数据库并将其读出,并以日志形式打印出来。所以这部分工作,你可以在日志中看到。
然后我将对象添加到我自己的适配器并将适配器设置为listView。
我不知道出了什么问题。这里是我的项目:https://github.com/Visores/de.fhb.android.todoapp/tree/master/MyTodoApp
,这里是开始活动的应用程式后的日志:
12-06 06:02:46.977: I/ActivityManager(1261): Start proc de.fhb.maus.android.mytodoapp for activity de.fhb.maus.android.mytodoapp/.activities.LoginActivity: pid=2576 uid=10064 gids={50064}
12-06 06:02:47.117: D/dalvikvm(2576): GC_FOR_ALLOC freed 36K, 4% free 3552K/3680K, paused 31ms, total 34ms
12-06 06:02:47.227: D/(2576): HostConnection::get() New Host Connection established 0xb7dc0a70, tid 2576
12-06 06:02:47.247: W/EGL_emulation(2576): eglSurfaceAttrib not implemented
12-06 06:02:47.257: D/OpenGLRenderer(2576): Enabling debug mode 0
12-06 06:02:47.567: I/ActivityManager(1261): Displayed de.fhb.maus.android.mytodoapp/.activities.LoginActivity: +609ms (total +7s839ms)
12-06 06:02:49.237: I/ActivityManager(1261): START u0 {cmp=de.fhb.maus.android.mytodoapp/.activities.TodoOverviewActivity} from pid 2576
12-06 06:02:49.277: D/dalvikvm(2576): GC_FOR_ALLOC freed 105K, 5% free 3960K/4140K, paused 2ms, total 3ms
12-06 06:02:49.287: D/dalvikvm(2576): GC_FOR_ALLOC freed 7K, 3% free 4264K/4368K, paused 2ms, total 2ms
12-06 06:02:49.297: I/dalvikvm-heap(2576): Grow heap (frag case) to 6.654MB for 2536932-byte allocation
12-06 06:02:49.317: D/dalvikvm(2576): GC_FOR_ALLOC freed 1K, 2% free 6740K/6848K, paused 18ms, total 18ms
12-06 06:02:49.387: D/Todos(2576): [Todo [id=1, name=one, description=one, isDone=false, isImportant=true, maturityDate=1231232], Todo [id=2, name=two, description=two, isDone=true, isImportant=true, maturityDate=1231232], Todo [id=3, name=three, description=three, isDone=true, isImportant=false, maturityDate=1231232], Todo [id=4, name=four, description=four, isDone=true, isImportant=true, maturityDate=1231232]]
12-06 06:02:49.427: W/EGL_emulation(2576): eglSurfaceAttrib not implemented
12-06 06:02:49.457: I/ActivityManager(1261): Displayed de.fhb.maus.android.mytodoapp/.activities.TodoOverviewActivity: +220ms
问候Visores
布局列表行: https://github.com/Visores/de.fhb.android.todoapp/blob/master/MyTodoApp/res/layout/rowlayout.xml
布局的活动: https://github.com/Visores/de.fhb.android.todoapp/blob/master/MyTodoApp/res/layout/todo_overview.xml
秀适应呃和活动类 – 2014-12-06 11:18:43
这是所有在github回购:) – Visores 2014-12-06 11:33:06
只是重写'getCount()'方法:) – 2014-12-06 12:33:53