Spinner widget setposition

by Federico Paolinelli » Tue, 25 Aug 2009 01:05:40 GMT


Sponsored Links
 Hi all,
I am having some problems using a spinner with a SimpleCursorAdapter.
Basically, my activity ships a button to start a new activity that add
new items to the table the spinner is linked to.
Everything works beautifully, but the problems started when I wanted
to set the spinner to the last created item. I thought that returing
the rowid of the new item would have been ok, but the code

if(resultCode == Activity.RESULT_OK){
        Long rowid = data.getLongExtra(mDbHelper.ST_ROW_ID, -1);
        if(rowid != -1){
                mSpinner.setSelection(rowid.intValue());
        }
        return;
}

has no effect on the spinner. I also tried to force manually to some
value the argument of setSelection, with no results. Moreover, I am
not sure setSelection would be the right method, since it accepts a
position and not an id.

Any  hints?
Thanks in advance and best regards,
         Federico

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



Other Threads

1. how to disable image shrinking for setBackgroundDrawable

Hi,

Just set the drawable's gravity to Gravity.CENTER for instance.






-- 
Romain Guy
www.curious-creature.org

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

2. Bionic libc build error [undefined reference to `__aeabi_unwind_cpp_pr0'

Hi All,

I am trying to build Android with our toolchain, this toolchain
(libgcc.a) doesn't have `__aeabi_unwind_cpp_pr0'.
For glibc we use to disable it by providing --disable-libunwind-
exceptions option to configure of glibc.

Is there anyway to disable this error in bionic libc?

Shankar
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: 

3. CRT Monitors

4. how to disable image shrinking for setBackgroundDrawable

5. Onscreen Numeric Keypad

6. IMAP Email message body is "null"

7. Starting Android Service at boot time