Skip object in BasicAdapter / CustomListAdapter

by 艁ukasz Warcho艂 » Fri, 27 Feb 2009 21:42:39 GMT


Sponsored Links
 Hi all,
I have my own ListAdapter  drawing my list. But i have a question. Is it 
possible to skip(not draw) object?
For example: I have a ArrayList with things to draw, and dont wanto to 
draw one at positon 2. Anyone nows how to?
Thanks.

--~--~---------~--~----~------------~-------~--~----~



Skip object in BasicAdapter / CustomListAdapter

by Mark Murphy » Fri, 27 Feb 2009 21:47:15 GMT


 


Expanding on your example, let us assume you have a six-item list, and
you do not want to draw the one at position 2 -- you only want to draw
positions 0, 1, 3, 4, and 5.

You would need to override getCount(), getItem(), and every other
Adapter method that knows about the number and positions of objects. You
would have getCount() return 5 instead of 6 (since you are only drawing
5) and have getItem(), getView(), etc. know to subtract 1 from the
supplied position if the supplied position > 2.

It would be far simpler to just remove the offending item from the list
in the first place, if possible.

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com 
_The Busy Coder's Guide to Android Development_ Version 2.0 Published!

--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Skip object in BasicAdapter / CustomListAdapter

by 艁ukasz Warcho艂 » Fri, 27 Feb 2009 21:50:28 GMT


 Yeah, i was thinking about deleting it from the list, but i thought taht 
there is any way of returning null from GetView(). Ok I think i'll 
delele this file form list. Thanks

Mark Murphy pisze:




--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. How to import individual projects from Android Source Code

As far as I understand, all the built-in standard apps like (email,
music, calendar etc) are built using the same API. So I should be able
to import a project like mail / music etc without checking out the
full source repository of android. I'v been trying that but I am
getting compilation problems like class resolve failure.


Am I doing it wrong? What do I have to do to import a project in
eclipse without compilation error. I am interested in the Music
application.

NOTE: I have setup the latest android eclipse plugin and run test
applications with it, so my setup is OK.

-- 

2. the webview will crash

I use WebView to show a rich-javascript web page, and it crash in
seconds when start, i paste the logcat information below, appreciate
for any advise!

[locat info]

07-13 15:42:45.690: INFO/DEBUG(54): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
07-13 15:42:45.690: INFO/DEBUG(54): Build fingerprint: 'htc_asia_wwe/
htc_legend/legend/legend:2.1/ERD79/150763:user/release-keys'
07-13 15:42:45.690: INFO/DEBUG(54): pid: 5268, tid: 5275  >>>
com.tieto.web <<<
07-13 15:42:45.690: INFO/DEBUG(54): signal 11 (SIGSEGV), fault addr
00000004
07-13 15:42:45.690: INFO/DEBUG(54):  r0 00000000  r1 004e7ff0  r2
ffffffe2  r3 0056d710
07-13 15:42:45.690: INFO/DEBUG(54):  r4 45f01d04  r5 00000013  r6
00000010  r7 00000051
07-13 15:42:45.690: INFO/DEBUG(54):  r8 45f01d00  r9 00000000  10
00000000  fp 0000000d
07-13 15:42:45.690: INFO/DEBUG(54):  ip 80000000  sp 45f01cf0  lr
aa0cb938  pc aa23897c  cpsr 40000010
07-13 15:42:45.730: INFO/DEBUG(54):          #00  pc 0023897c  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #01  pc 000cb934  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #02  pc 00187ff8  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #03  pc 005204ac  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #04  pc 0010d07c  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #05  pc 0073f808  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #06  pc 00742860  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #07  pc 0074349e  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #08  pc 001088e0  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #09  pc 0053001c  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #10  pc 000d1388  /system/
lib/libwebcore.so
07-13 15:42:45.730: INFO/DEBUG(54):          #11  pc 005b688c  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #12  pc 006bed94  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #13  pc 000b7938  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #14  pc 0043e524  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #15  pc 00448e04  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #16  pc 00481d44  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #17  pc 004762c8  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #18  pc 004acab4  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #19  pc 004acd74  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #20  pc 0027d54c  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #21  pc 00013f38  /system/
lib/libwebcore.so
07-13 15:42:45.740: INFO/DEBUG(54):          #22  pc 0000f3f4  /system/
lib/libdvm.so
07-13 15:42:45.740: INFO/DEBUG(54):          #23  pc 000383c4  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #24  pc 00014158  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #25  pc 00019c74  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #26  pc 0001914c  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #27  pc 0004dedc  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #28  pc 0004df0a  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #29  pc 000422c6  /system/
lib/libdvm.so
07-13 15:42:45.750: INFO/DEBUG(54):          #30  pc 00010070  /system/
lib/libc.so
07-13 15:42:45.750: INFO/DEBUG(54):          #31  pc 0000fb44  /system/
lib/libc.so
07-13 15:42:45.750: INFO/DEBUG(54): code around pc:
07-13 15:42:45.750: INFO/DEBUG(54): aa23896c e2800fab e12fff1e
e59002a8 e12fff1e
07-13 15:42:45.750: INFO/DEBUG(54): aa23897c e5900004 e3500000
1590001c e12fff1e
07-13 15:42:45.750: INFO/DEBUG(54): aa23898c e2800e2f e12fff1e
e2800e3e e12fff1e
07-13 15:42:45.750: INFO/DEBUG(54): code around lr:
07-13 15:42:45.750: INFO/DEBUG(54): aa0cb928 eb08104d e59d1004
e591008c eb05b410
07-13 15:42:45.750: INFO/DEBUG(54): aa0cb938 e1a01008 e59d2000
eb06378a e59d600c
07-13 15:42:45.750: INFO/DEBUG(54): aa0cb948 e3560000 0a000004
e5960000 e3500001
07-13 15:42:45.750: INFO/DEBUG(54): stack:
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cb0  0000000d
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cb4  0056d728  [heap]
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cb8  45f01ce4
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cbc  aa2d6b40  /system/
lib/libwebcore.so
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cc0  003119ec  [heap]
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cc4  00000003
07-13 15:42:45.750: INFO/DEBUG(54):     45f01cc8  00000051
07-13 15:42:45.750: INFO/DEBUG(54):     45f01ccc  45f01cfc
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cd0  00000013
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cd4  00000010
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cd8  00000051
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cdc  aa2cfa88  /system/
lib/libwebcore.so
07-13 15:42:45.760: INFO/DEBUG(54):     45f01ce0  003119b0  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01ce4  0056d710  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01ce8  df002777
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cec  e3a070ad
07-13 15:42:45.760: INFO/DEBUG(54): #01 45f01cf0  45f01cfc
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cf4  004e7ff0  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cf8  45f01d4f
07-13 15:42:45.760: INFO/DEBUG(54):     45f01cfc  0056d710  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d00  0056d6d8  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d04  0056d618  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d08  45f01d34
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d0c  003119b0  [heap]
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d10  00000c44
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d14  00000001
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d18  aa82b2f8  /system/
lib/libwebcore.so
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d1c  45f01db4
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d20  45f01dbc
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d24  45f01db8
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d28  00000000
07-13 15:42:45.760: INFO/DEBUG(54):     45f01d2c  aa187ffc  /system/
lib/libwebcore.so
07-13 15:42:46.400: INFO/ActivityManager(109): Process com.tieto.web
(pid 5268) has died.
07-13 15:42:46.400: INFO/WindowManager(109): WIN DEATH:
Window{45047720 com.tieto.web/com.tieto.web.WebTest paused=false}
07-13 15:42:46.420: ERROR/ActivityManager(109): fail to set top app
changed!
07-13 15:42:46.420: DEBUG/Sensors(109): close_akm, fd=169
07-13 15:42:46.430: DEBUG/Zygote(56): Process 5268 terminated by
signal (11)
07-13 15:42:46.440: INFO/UsageStats(109): Unexpected resume of
com.htc.launcher while already resumed in com.tieto.web
07-13 15:42:46.500: DEBUG/dalvikvm(185): GC freed 5674 objects /
318936 bytes in 218ms
07-13 15:42:46.520: WARN/InputManagerService(109): Got RemoteException
sending setActive(false) notification to pid 5268 uid 10061
07-13 15:42:46.820: DEBUG/AK8973(61): Compass CLOSE

-- 

3. How to reuse an existing Java interface inside of an AIDL definition

4. how to disconnect the incomming call

5. proxy

6. How can I tell if I am running inside the UI thread context?

7. play RTSP stream using MediaPlayer or VideoView