Creates a new ArrayAdapter from external resources. The content of the array is obtained through getTextArray(int).
ArrayAdapter.createFromResource(MyActivity.this, R.array.my_array.xml, R.layout.spinner_item);
In your case you have to use below way :-
new ArrayAdapter<String>(this, R.layout.spinner_layout, myArray);