2011-07-18 21 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

相關問題