2011-07-18 22 views
0

我想使用1000多首歌曲进行自定义列表视图。但在我的应用程序中,200首歌曲的listview工作正常,但当我添加超过400首歌曲时,应用程序会关闭。 在logcat中,我收到了这些消息。如何使自定义ListView的列表数量不受限制

07-18 18:59:35.625: ERROR/IMemory(625): binder=0x596550 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646) 
07-18 18:59:35.625: ERROR/IMemory(625): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number) 
07-18 18:59:35.625: ERROR/IMemory(625): cannot map BpMemoryHeap (binder=0x596550), size=0, fd=-1 (Bad file number) 
07-18 18:59:35.625: ERROR/JavaBinder(625): *** Uncaught remote exception! (Exceptions are not yet supported across processes.) 
07-18 18:59:35.625: ERROR/JavaBinder(625): java.lang.RuntimeException: No memory in memObj 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.database.CursorWindow.native_init(Native Method) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.database.CursorWindow.<init>(CursorWindow.java:518) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.database.CursorWindow.<init>(CursorWindow.java:27) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:493) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.database.CursorWindow$1.createFromParcel(CursorWindow.java:496) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:103) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at android.os.Binder.execTransact(Binder.java:288) 
07-18 18:59:35.625: ERROR/JavaBinder(625):  at dalvik.system.NativeStart.run(Native Method) 
07-18 18:59:35.635: ERROR/IMemory(625): binder=0x597b10 transaction failed fd=-2147483647, size=0, err=-2147483646 (Unknown error: 2147483646) 
07-18 18:59:35.635: ERROR/IMemory(625): cannot dup fd=-2147483647, size=0, err=-2147483646 (Bad file number) 
07-18 18:59:35.635: ERROR/IMemory(625): cannot map BpMemoryHeap (binder=0x597b10), size=0, fd=-1 (Bad file number) 
07-18 18:59:35.635: ERROR/JavaBinder(625): *** Uncaught remote exception! (Exceptions are not yet supported across processes.) 

请建议我在哪里出错。

+0

你如何添加列表项?您是否使用自定义适配器? –

回答

0

1000+歌曲是ListView中的一大笔钱。这意味着您一次可以在屏幕上显示1,000多个活动视图。我主要确定这太多了。由于内存不足,您正在收到这些错误。也许你应该试着更聪明地表达歌曲的表现方式,比如有一个工作视角~100,当它滚动时会发生变化。它会更复杂,但它应该工作。

+0

如果你提出了一些实现,会不会更好?你写的只是常识。 – Gio

相关问题