CheckedListView sparse boolean array

by raqz » Thu, 22 Apr 2010 08:03:53 GMT


Sponsored Links
 Hi,

I am trying to use the
android.R.layout.simple_list_item_multiple_choice, with
CHOICE_MODE_MULTIPLE.
The contents are being displayed all right. Even if I happen to select
the items starting from the first item then it works fine. But if in
case, I select the last item ONLY, the program doesnt store the name
in the array selected.
SparseBooleanArray positions;
positions = listView.getCheckedItemPositions();

                int j =0;
                selected = new String[size];

                for(int k =0; k < positions.size();k++){
                    if(positions.get(k)){
                        selected[j++]=items[k];
                    }

                }


Please let me know..
Thanks
Raqeeb

--



CheckedListView sparse boolean array

by raqz » Thu, 22 Apr 2010 10:03:13 GMT


 I got the answer for that, we need to increment the for loop till the
end of the list that was displayed.
the right code would be
SparseBooleanArray positions;



>


Sponsored Links


Other Threads

1. ANDROID: Kernel panic - not syncing: Attempted to kill init!

Hi All

I am porting Android 2.2 on following hardware.

HARDWARE:
ARM11 Family 32bits core x 3 MPCore CPU

OS:
Already running 2.6.33 based Monta Vista Linux

I took out the Android changes from Android kernel (2.6.32.9 based
kernel) and applied the changes to MV Linux.

Now MV Linux kernel with Android changes is compiling fine and board
is able to bring up with existing MV Root file system, I am able to
see some ASHMEM, BINDER device files.

Then I compiled the FROYO 2.2 and got ramdisk.img, userdata.img and
system.img.
I extracted these files at one place and tried to deploy this file
system using NFS and USB.
But I get this error:

[    4.590000] IP-Config: Complete:
[    4.600000]      device=eth0, addr=192.168.2.55,
mask=255.255.255.0, gw=255.255.255.255,
[    4.600000]      host=192.168.2.55, domain=, nis-domain=(none),
[    4.610000]      bootserver=255.255.255.255,
rootserver=255.255.255.255, rootpath=
[    4.620000] Waiting for root device /dev/sda1...
[    7.220000] scsi 0:0:0:0: Direct-Access     JetFlash Transcend
4GB    8.07 PQ: 0 ANSI: 2
[    7.230000] sd 0:0:0:0: [sda] 7843840 512-byte logical blocks:
(4.01 GB/3.74 GiB)
[    7.240000] sd 0:0:0:0: [sda] Write Protect is off
[    7.240000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    7.250000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    7.260000]  sda: sda1
[    7.760000] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    7.760000] sd 0:0:0:0: [sda] Attached SCSI removable disk
[    7.780000] EXT2-fs (sda1): warning: mounting unchecked fs, running
e2fsck is recommended
[    7.790000] VFS: Mounted root (ext2 filesystem) on device 8:1.
[    7.790000] Freeing init memory: 144K
[    7.800000] Warning: unable to open an initial console.
[    7.820000] Kernel panic - not syncing: Attempted to kill init!
[    7.820000] [<c0033b90>] (unwind_backtrace+0x0/0xdc) from
[<c03a1c10>] (panic+0x58/0x130)
[    7.830000] [<c03a1c10>] (panic+0x58/0x130) from [<c00476d8>]
(do_exit+0x70/0x610)
[    7.840000] [<c00476d8>] (do_exit+0x70/0x610) from [<c0047d08>]
(do_group_exit+0x90/0xc4)
[    7.850000] [<c0047d08>] (do_group_exit+0x90/0xc4) from
[<c00528c4>] (get_signal_to_deliver+0x348/0x380)
[    7.860000] [<c00528c4>] (get_signal_to_deliver+0x348/0x380) from
[<c002fcc0>] (do_notify_resume+0x74/0x600)
[    7.870000] [<c002fcc0>] (do_notify_resume+0x74/0x600) from
[<c002d0ec>] (work_pending+0x1c/0x20)
[    7.880000] CPU0: stopping
[    7.880000] [<c0033b90>] (unwind_backtrace+0x0/0xdc) from
[<c002c2b8>] (do_IPI+0xc8/0x13c)
[    7.880000] [<c002c2b8>] (do_IPI+0xc8/0x13c) from [<c002cc4c>]
(__irq_svc+0x4c/0xe4)
[    7.880000] Exception stack(0xc04ddf80 to 0xc04ddfc8)
[    7.880000] df80: 00000000 00000000 c04ddfc8 00000000 c04dc000
c00247d0 c04dc000 c04eddcc
[    7.880000] dfa0: 800232a0 410fb024 80023238 00000000 00000003
c04ddfc8 c002e2e0 c002e2e4
[    7.880000] dfc0: 60000013 ffffffff
[    7.880000] [<c002cc4c>] (__irq_svc+0x4c/0xe4) from [<c002e2e4>]
(default_idle+0x24/0x28)
[    7.880000] [<c002e2e4>] (default_idle+0x24/0x28) from [<c002eb20>]
(cpu_idle+0x74/0xcc)
[    7.880000] [<c002eb20>] (cpu_idle+0x74/0xcc) from [<c0008a88>]
(start_kernel+0x250/0x2a8)
[    7.880000] [<c0008a88>] (start_kernel+0x250/0x2a8) from
[<80008080>] (0x80008080)
[    7.880000] CPU1: stopping
[    7.880000] [<c0033b90>] (unwind_backtrace+0x0/0xdc) from
[<c002c2b8>] (do_IPI+0xc8/0x13c)
[    7.880000] [<c002c2b8>] (do_IPI+0xc8/0x13c) from [<c002cc4c>]
(__irq_svc+0x4c/0xe4)
[    7.880000] Exception stack(0xcf849fa0 to 0xcf849fe8)
[    7.880000] 9fa0: 00000000 00000000 cf849fe8 00000000 cf848000
0000001f 00c0387d c0518f44
[    7.880000] 9fc0: 00000000 410fb024 80023238 00000000 00000003
cf849fe8 c002e2e0 c002e2e4
[    7.880000] 9fe0: 60000013 ffffffff
[    7.880000] [<c002cc4c>] (__irq_svc+0x4c/0xe4) from [<c002e2e4>]
(default_idle+0x24/0x28)
[    7.880000] [<c002e2e4>] (default_idle+0x24/0x28) from [<c002eb20>]
(cpu_idle+0x74/0xcc)
[    7.880000] [<c002eb20>] (cpu_idle+0x74/0xcc) from [<80008080>]
(0x80008080)

Regards
Yogi

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. am3517evm audio issue

Dear all:
I've run rowboat's android on am3517evm successfully.
But the audio doesn't work no matter I play MP3 by music player or
pick ringtones.

I tried to set the both variables,
"BOARD_USES_ALSA_AUDIO := true"
"BUILD_WITH_ALSA_UTILS := true"

instead

"BOARD_USES_GENERIC_AUDIO := true".

and copied asound.conf from beagleboard.

I found the alsa-related library were built and populated to system/
lib/.
Unforturnitly, It still doesn't work..

Do I miss anything?
or rowboat hasn't finished this part yet?

Thanks a million in advance ^.^

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

3. Porting Android to Samsung h1/m1 i6410/i8320

4. Mpeg2 decoder on Opencore

5. Android ADB Connection issue on a PXA27x hardware

6. Where to find developmet tablet

7. query about LOCAL_LDLIBS