How to obtain the value of the spinners that have been "inflated" from a layout, in a certain number of times?

0

Good, these days I had a problem, I will use inflate to inflate a layout into another layout, the layout that contains a Spinner insert but the problem I have is that when I want to get the id of the spinner that insert so be 4 or 10 the problem is the same, but wanting to get it by the id, I only take the value of the first spinner that inserts I use this line of code to inflate the layout infla = View.inflate(getActivity(),R.layout.nuevos_spinner_materiales,layout);

The following XML is the one that appeared

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="5dp">

<Spinner
    android:id="@+id/spinner2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:entries="@array/tipos_materiales"
    android:layout_alignParentTop="true"
    android:layout_alignParentStart="true" />

<EditText
    android:id="@+id/cantidadMaterial1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentStart="true"
    android:layout_below="@+id/spinner2"
    android:layout_marginTop="2dp"
    android:ems="10"
    android:hint="@string/cantidad"
    android:inputType="number" />
</RelativeLayout>

If you could help me, I would be very grateful

    
asked by JesusSh 04.01.2018 в 23:17
source

0 answers