Hi.
I have a spinner with an array of items.
Now I want to add a blank item
so that the user has the choice of
using an element or writes an own entry.

My main.xml looks like this:
....
    <Spinner android:id="@+id/length"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:autoText="true"
        android:drawSelectorOnTop="true">
    </Spinner>
.....
And in my array.xml i have the arrayList
    <string-array name="Numbers">
        <item> 555</item>
        <item> 852</item>
        <item> 65</item>
    </string-array>

And in the .java file it looks like this:
        Spinner nummer = (Spinner) findViewById(R.id.number);
        ArrayAdapter<CharSequence> uriAdapter =
ArrayAdapter.createFromResource(
                this, R.array.Numbers,
android.R.layout.simple_spinner_item);
        uriAdapter.setDropDownViewResource
(android.R.layout.simple_spinner_dropdown_item);
        nummer.setAdapter(uriAdapter);

My idea was to add not an item but an EditText like this:

    <string-array name="Numbers">
        <item> 555</item>
        <item> 852</item>
        <item> 65</item>
        <EditText android:id="@+id/enummer"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:autoText="true"
                android:capitalize="sentences"
                android:layout_weight="1"
                android:freezesText="true">
        </EditText>
    </string-array>

but this wouldn't work.
Has anybody an idea what way i can realize that?


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to