here i save data in Array listthat is semesterlist :-

```
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Request.Method.GET,
            "http://www.mytat.in/API/semester?tokenno=xvub4jey66c7ec6tb4j7g83ghjls353\n", new JSONObject(postParam),
            new Response.Listener<JSONObject>() {

                @Override
                public void onResponse(JSONObject response) {
                    Log.e("response", response.toString());

                    try {

                        JSONArray output = response.getJSONArray("output");
                        Log.e("semester",output.toString());

                        for ( int j =0 ; j<output.length();j++) {

                            JSONObject semester = output.getJSONObject(j);
                            Log.e("semester value", semester.toString());

                            for (int i = 0; i<semester.length();i++){

                                Map<String,String> map = new HashMap<String,String>();
                                Iterator iterator = semester.keys();
                                while (iterator.hasNext()){

                                    String key = (String) iterator.next();
                                    Log.e("key", key);
                                    String value = semester.getString(key);
                                    Log.e("value", value);
                                    if (key .equals("semester")){
                                        semesterlist.add(value);
                                        Log.e("semesterlist",semesterlist.toString());
                                    }

                                }
                                break;

                            }

                        }

                    } catch (JSONException e) {
                        Log.e("responsejson", "Error: " + e.toString());
                    }
                    hidepDialog();

                }
            }, new Response.ErrorListener() 

```

Here is my adapter

```
ArrayAdapter<String> studentsem= new ArrayAdapter<String>(getActivity(),android.R.layout.simple_spinner_item,semesterlist);
    studentsem.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
    spinnersemester.setAdapter(studentsem);

    spinnersemester.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {

        @Override
        public void onItemSelected(AdapterView<?> adapterView, View view,
                                   int position, long id) {
            Object item = adapterView.getItemAtPosition(position);
            if (item != null) {

            }

        }

        @Override
        public void onNothingSelected(AdapterView<?> adapterView) {
            // TODO Auto-generated method stub)

        }
    });

```

here is my layout

```
    <Spinner
        android:layout_width="match_parent"
        android:layout_height="35dp"
        android:id="@+id/spinner_one"
        android:layout_marginTop="20dp"
        android:background="@color/loginbg">

    </Spinner>

```