Android examples for android.widget:Adapter
get Spinner Adapter from String array
import android.content.Context; import android.widget.ArrayAdapter; public class Main{ public static ArrayAdapter<String> getSpinnerAdapter(Context context, String[] datas) {/*from w ww . j a v a2 s.c o m*/ ArrayAdapter<String> adapter = new ArrayAdapter<String>(context, android.R.layout.simple_spinner_item, datas); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); return adapter; } }