Spinner getting selected string

by matio » Sat, 17 Apr 2010 06:16:30 GMT


Sponsored Links
 Hi everyone, I'm trying to expand a todo list program taken from a
tutorial in a magazine. The problem I'm having is getting the value
from a spinner that is selecting the priority of the item, how do I do
it? I think it is something to do with views but how do I get the
string?

Thanks in advance...

--



Spinner getting selected string

by Bob Kerns » Sat, 17 Apr 2010 10:52:49 GMT


 You have a few options. You can ask the view for the position of the
selected item (getSelectedItemPosition()), or the ID you associated
with that item (getSelectedItemId()), or register listener with
setOnItemSelectedListener().

You can get the associated item with getSelectedItem(). You can get
the associated View with getSelectedView(), and you can extract
relevant state from that. You can also register listeners on items
within the view, if they will be changing state as the result of your
interactions with them.

Use whatever is simplest for your application.



>


Sponsored Links


Other Threads

1. Shape drawing - issue with corners

Hi,
I am following the instruction here:
http://developer.android.com/guide/topics/resources/drawable-resource.html

and I am trying to draw a rectangle with only 2 rounded corners.

Here is my xml

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">

        <corners android:radius="15dp" android:bottomRightRadius="0dp"
                 android:bottomLeftRadius="0dp" />
        <gradient android:angle="90" android:startColor="#c45209"
                android:endColor="#edb18c" android:centerColor="#ea6814" />
</shape>

I tried many variations, with or without the android:radius attribute
but no luck.
Any suggestions?
Thanks,
Lior

-- 

2. Draw a closed polygon witihin mapview

Hello,

I want to display borders(based on GeoPoints) on my mapview but
android does not support anything like:

java.awt.polygon

At the moment i solve this with the following code in the draw-method
of an ItemizedOverlay:

for(int i = 0;i< geopoints.size();i++){


                                if(i<size()-1)
                                        canvas.drawLine(Point(i).x, Point(i).y, 
Point(i+1).x, Point(i+1),
mPaint);
                                //Auer beim letzen Punkt: zeichne hier zum 
ersten Punkt:
Geschlossenheit
                                else
                                        
mapView.getProjection().toPixels(((OverlayItem)
mOverlays.get(0)).getPoint(), pxNew);
                                canvas.drawLine(pxOld.x, pxOld.y, pxNew.x, 
pxNew.y, mPaint);
                        }

-- 

3. Help with Hacking the State of the Union

4. http connection

5. android:horizontalSpacing

6. citrix gateway access problem

7. Map utk Ndrive