开发者

How to make Custom ListView with unlimited number of list

开发者 https://www.devze.com 2023-03-21 05:54 出处:网络
I want to make a custom listview with 1000+ songs. But in my application, 200 songs listview is working fine but when I add more than 400 songs , application get force close.

I want to make a custom listview with 1000+ songs. But in my application, 200 songs listview is working fine but when I add more than 400 songs , application get force close. In logcat I get these msg.

    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:3开发者_Python百科5.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.)

Please Suggest me where I am going wrong.


1,000+ songs is an intense amount to have in a ListView. It means you're going to have 1,000+ active Views on screen at one time. I'm mostly certain that is too much. You are getting these errors because you are out of memory. Perhaps you should try to be a little more clever about how you display songs, like have a working view with ~100 that changes as it scrolls. It will be more complicated, but it should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消