Q: Setting text of a selected item on a spinner So I'm trying to show on a text view a selected item in a spinner,but I don't know why,it doesn't show the selected item on the spinner, it shows like an empty spinner and I would really appreciate if you can help me.
ps: All the items,in the spinners are String.
Java code:
   setContentView(R.layout.activity_verpedido);

    RelativeLayout verpedido = (RelativeLayout) findViewById(R.id.verpedido);

    View sanduche = getLayoutInflater().inflate(R.layout.activity_aprisasanduche, null);

    verpedido.addView(sanduche);

    String item1, item2;
    int price;
    TextView tvItem1, tvItem2, tvItem3, tvItem4;
    Spinner Sping1, Sping2, Sping3, Sping4;
    String Ssanduche1, Ssanduche2, Ssanduche3, Ssanduche4;

    Sping1 = (Spinner)findViewById(R.id.Sing1);
    Sping2 = (Spinner)findViewById(R.id.Sing2);
    Sping3 = (Spinner)findViewById(R.id.Sing3);
    Sping4 = (Spinner)findViewById(R.id.Sing4);

    tvItem1 = (TextView)findViewById(R.id.vering1);
    tvItem2 = (TextView)findViewById(R.id.vering2);
    tvItem3 = (TextView)findViewById(R.id.vering3);
    tvItem4 = (TextView)findViewById(R.id.vering4);

    Ssanduche1 = (String) Sping1.getSelectedItem();
    Ssanduche2 = (String) Sping2.getSelectedItem();
    Ssanduche3 = (String) Sping3.getSelectedItem();
    Ssanduche4 = (String) Sping4.getSelectedItem();

    tvItem1.setText(Ssanduche1);
    tvItem2.setText(Ssanduche2);
    tvItem3.setText(Ssanduche3);
    tvItem4.setText(Ssanduche4);

.xml principal 


<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/verpedido"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.unlunch.unlunch.VerPedido"
    android:background="#CC2124"
    >
    <TextView
        android:id="@+id/ting1"
        android:text="@string/Str_ing1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:layout_marginLeft="10dp"
        android:textColor="#FFF1FE"
        android:textColorHint= "#7A02CC"
        android:textSize="17dp"
        android:textStyle="italic"
        />

    <TextView
        android:id="@+id/vering1"
        android:text=" "
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ting1"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textColorHint= "#7A02CC"
        android:textSize="17dp"
        android:textStyle="italic"
        />

    <TextView
        android:id="@+id/ting2"
        android:text="@string/Str_ing2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="10dp"
        android:textColor="#FFF1FE"
        android:textSize="17dp"
        android:textStyle="italic"
        android:layout_below="@+id/vering1"
        />

    <TextView
        android:id="@+id/vering2"
        android:text=" "
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ting2"
        android:layout_marginTop="10dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textColorHint= "#7A02CC"
        android:textSize="17dp"
        android:textStyle="italic"
        />

    <TextView
        android:id="@+id/ting3"
        android:text="@string/Str_ing3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/vering2"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textSize="17dp"
        android:textStyle="italic"
        />

    <TextView
        android:id="@+id/vering3"
        android:text=" "
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ting3"
        android:layout_marginTop="50dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textColorHint= "#7A02CC"
        android:textSize="17dp"
        android:textStyle="italic"
        />

    <TextView
        android:id="@+id/ting4"
        android:text="@string/Str_ing4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/vering3"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textSize="17dp"
        android:textStyle="italic"
        />

    <TextView
        android:id="@+id/vering4"
        android:text=" "
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/ting4"
        android:layout_marginTop="50dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textColorHint= "#7A02CC"
        android:textSize="17dp"
        android:textStyle="italic"
        />

</RelativeLayout>


.xml secondary 


<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:id="@+id/sanduche"
    xmlns:tools="http://schemas.android.com/tools"
    tools:context="com.unlunch.unlunch.AprisaSanduche"
    android:background="#CC2124"
    >
    <TextView
        android:id="@+id/ting1"
        android:text="@string/Str_ing1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="50dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textColorHint= "#7A02CC"
        android:textSize="17dp"
        android:textStyle="italic"
        />
    <Spinner
        android:id="@+id/Sing1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_alignLeft="@+id/ting1"
        android:layout_alignStart="@+id/ting1"
        android:popupBackground="#CC413D"
        android:layout_below="@+id/ting1"
        />

    <TextView
        android:id="@+id/ting2"
        android:text="@string/Str_ing2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="10dp"
        android:textColor="#FFF1FE"
        android:textSize="17dp"
        android:textStyle="italic"
        android:layout_below="@+id/Sing1"
        />
    <Spinner
        android:id="@+id/Sing2"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/ting2"
        android:layout_alignLeft="@+id/ting2"
        android:layout_alignStart="@+id/ting2"
        android:popupBackground="#CC413D"
        />

    <TextView
        android:id="@+id/ting3"
        android:text="@string/Str_ing3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/Sing2"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textSize="17dp"
        android:textStyle="italic"
        />
    <Spinner
        android:id="@+id/Sing3"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/ting3"
        android:layout_alignLeft="@+id/ting3"
        android:layout_alignStart="@+id/ting3"
        android:popupBackground="#CC413D"
        />

    <TextView
        android:id="@+id/ting4"
        android:text="@string/Str_ing4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_below="@+id/Sing3"
        android:layout_marginTop="30dp"
        android:layout_marginLeft="10dp"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="false"
        android:textColor="#FFF1FE"
        android:textSize="17dp"
        android:textStyle="italic"
        />
    <Spinner
        android:id="@+id/Sing4"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/ting4"
        android:layout_alignLeft="@+id/ting4"
        android:layout_alignStart="@+id/ting4"
        android:popupBackground="#CC413D"
        />

    <Button
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Str_ver"
        android:id="@+id/verBt"
        android:layout_marginTop="50dp"
        android:layout_marginLeft="10dp"
        android:layout_below="@+id/Sing4"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        />

    <Button
        style="?android:attr/buttonStyleSmall"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/Str_back"
        android:id="@+id/backBt"
        android:layout_marginTop="0dp"
        android:layout_marginLeft="10dp"
        android:layout_below="@+id/verBt"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        />
</RelativeLayout>



A: Try this.. 
firstly set the adapter to your spinner and also do as for all spinner
String[] mArray; //parameter initialize

mArray=getResources().getStringArray(R.array.mArray);

Sping1.setAdapter(new MyCustomAdapter(getActivity(), R.layout.row_spinner_data_sync, mArray));

  Sping1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener()     {
        @Override
        public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
             str_sping1 =sp_post.getSelectedItem().toString();
          tvItem1.setText(str_sping1);

        }

        @Override
        public void onNothingSelected(AdapterView<?> adapterView) {

        }
    });

Array string take in your string.xml
<!--Array String-->
  <string-array name="mArray">

    <item>arrayvalue1</item>
    <item>arrayvalue2</item>
    <item>arrayvalue3</item>
    <item>arrayvalue4</item>
    <item>arrayvalue5</item>
  </string-array>

add MyCustomAdapter in your class.. you can try with inbuilt layout also..
    public class MyCustomAdapter extends ArrayAdapter<String>{

    String[] arrayAdapt;

    public MyCustomAdapter(Context context, int textViewResourceId,
                   String[] objects) {
        super(context, textViewResourceId, objects);

        arrayAdapt=objects;


    }

    @Override
    public View getDropDownView(int position, View convertView,
                    ViewGroup parent) {

        return getCustomView(position, convertView, parent);
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        return getCustomView(position, convertView, parent);
    }

    public View getCustomView(int position, View convertView, ViewGroup parent) {

        //return super.getView(position, convertView, parent);

        LayoutInflater inflater=getActivity().getLayoutInflater();
        View row=inflater.inflate(R.layout.row_spinner_data_sync, parent, false);
        TextView label=(TextView)row.findViewById(R.id.txt_organization);

        label.setTextSize(20);

        label.setText(arrayAdapt[position]);





        return row;
    }
    }

row_spinner_data_sync.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/txt_organization"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textColor="@color/txt_color"
android:layout_centerVertical="true"
android:layout_centerHorizontal="true"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp"
android:paddingBottom="2dp"
android:gravity="center_vertical"
android:textSize="20sp"
android:textStyle="bold"

android:text="name"
 />


A: Can use this code:
First load the spinner data with array adapter and then set an OnItemSelectedListener for each of them.. and finally load them into the textview
public class MainActivity extends AppCompatActivity {

    private String[] arraySpinner;
    private String[] arraySpinner2;
    private String[] arraySpinner3;
    private String[] arraySpinner4;
    TextView tvItem1, tvItem2, tvItem3, tvItem4;
    Spinner Sping1, Sping2, Sping3, Sping4;
    String Ssanduche1, Ssanduche2, Ssanduche3, Ssanduche4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {

        this.arraySpinner = new String[] {
                "1", "2", "3", "4", "5"
        };
        this.arraySpinner2 = new String[] {
                "6", "7", "8", "9", "10"
        };
        this.arraySpinner3 = new String[] {
                "11", "12", "13", "14", "15"
        };
        this.arraySpinner4 = new String[] {
                "1", "2", "3", "4", "5"
        };
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        RelativeLayout verpedido = (RelativeLayout) findViewById(R.id.verpedido);

        View sanduche = getLayoutInflater().inflate(R.layout.secondary, null);

        verpedido.addView(sanduche);

        String item1, item2;
        int price;


        Sping1 = (Spinner) findViewById(R.id.Sing1);
        Sping2 = (Spinner) findViewById(R.id.Sing2);
        Sping3 = (Spinner) findViewById(R.id.Sing3);
        Sping4 = (Spinner) findViewById(R.id.Sing4);

        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, arraySpinner);
        Sping1.setAdapter(adapter);
        ArrayAdapter<String> adapter2 = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, arraySpinner2);
        Sping2.setAdapter(adapter2);
        ArrayAdapter<String> adapter3 = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, arraySpinner3);
        Sping3.setAdapter(adapter3);
        ArrayAdapter<String> adapter4 = new ArrayAdapter<String>(this,
                android.R.layout.simple_spinner_item, arraySpinner4);
        Sping4.setAdapter(adapter4);

        tvItem1 = (TextView) sanduche.findViewById(R.id.ting1);
        tvItem2 = (TextView) sanduche.findViewById(R.id.ting2);
        tvItem3 = (TextView) sanduche.findViewById(R.id.ting3);
        tvItem4 = (TextView) sanduche.findViewById(R.id.ting4);

        Ssanduche1 = (String) Sping1.getSelectedItem().toString();
        Ssanduche2 = (String) Sping2.getSelectedItem().toString();
        Ssanduche3 = (String) Sping3.getSelectedItem().toString();
        Ssanduche4 = (String) Sping4.getSelectedItem().toString();

        tvItem1.setText(Ssanduche1);
        tvItem2.setText(Ssanduche2);
        tvItem3.setText(Ssanduche3);
        tvItem4.setText(Ssanduche4);

        Sping1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
                Ssanduche1 = (String) Sping1.getSelectedItem().toString();
                tvItem1.setText(Ssanduche1);

            }

            @Override
            public void onNothingSelected(AdapterView<?> adapterView) {

            }
        });

        Sping2.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
                Ssanduche2 = (String) Sping2.getSelectedItem().toString();
                tvItem2.setText(Ssanduche2);

            }

            @Override
            public void onNothingSelected(AdapterView<?> adapterView) {

            }
        });

        Sping3.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
                Ssanduche3 = (String) Sping3.getSelectedItem().toString();
                tvItem3.setText(Ssanduche3);

            }

            @Override
            public void onNothingSelected(AdapterView<?> adapterView) {

            }
        });

        Sping4.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
            @Override
            public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {
                Ssanduche4 = (String) Sping4.getSelectedItem().toString();
                tvItem4.setText(Ssanduche4);

            }

            @Override
            public void onNothingSelected(AdapterView<?> adapterView) {

            }
        });

    }
}


A: Firstly set Array to ArrayAdapter and then ArrayAdapter to spinner. Like this :
Spinner spinner = new Spinner(this);
ArrayAdapter<String> spinnerArrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, array); //set Array object as "array"
spinnerArrayAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner.setAdapter(spinnerArrayAdapter);

and then set selected text form spinner to textView - 
textView.setText(spinner.getSelectedItem().toString);


A: In your code(what you have provided), i did not see how you populated your spinners? You have 4 spinners, you have not provided entries for them, either in your xml, or in your java code. If you want to do it in xml, the solution is: 
    <Spinner
            android:id="@+id/Sing1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_alignLeft="@+id/ting1"
            android:layout_alignStart="@+id/ting1"
            android:popupBackground="#CC413D"
            android:layout_below="@+id/ting1"
            android:entries="@array/array_name"/>

In your strings.xml, you will have to create an array with some entries: 
<string-array name="array_name">
<item>Array Item One</item>
<item>Array Item Two</item>
<item>Array Item Three</item>
</string-array>

If you want to do it with java code, the implementation is below: 
// create a new ArrayList of Strings
ArrayList<String> entriesList = new ArrayList<String>();

// add items to it
entriesList.add("String 1");
entriesList.add("String 2");
entriesList.add("String 3");
entriesList.add("String 4");

// populate spinner
ArrayAdapter<String> dataAdapter = new ArrayAdapter<String>(this,
                R.layout.simple_spinner_item, entriesList);
   dataAdapter.setDropDownViewResource(R.layout.simple_spinner_dropdown_item);
        // attaching data adapter to spinner
        Sping1.setAdapter(dataAdapter);

I did not see any code populating your spinner, so i pasted this, maybe you have that code somewhere else.
Lastly, for updating any TextView based on what item in spinner has been selected is as follows:
Sping1.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

            @Override
            public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {

                String selected = (String) parent.getItemAtPosition(position);
                // update your TextView here
                // textView.setText(selected);
            }

            @Override
            public void onNothingSelected(AdapterView<?> parent) {

            }
        });

hope this is helpful. cheers!!
