You can create spinner by these simple steps
first create spinner in xml
<Spinner
android:id="@+id/select"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="#070707"></Spinner>
now create string arary in values
<string-array name="itemselect">
<item>Repurchase</item>
<item>Coupons</item>
</string-array>
now initialized in java file
public class MemberCart_Activity extends AppCompatActivity {
Spinner select;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_member_cart);
select=findViewById(R.id.select);
ArrayAdapter<String> myadapter=new ArrayAdapter<String>(Main_Activity.this,android.R.layout.simple_list_item_1,getResources().getStringArray(R.array.itemselect));
myadapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
select.setAdapter(myadapter);