如何从字符串数组中充填spinner?我知道在array.xml中可以这样实现:
ArrayAdapter<CharSequence> gameKindArray = ArrayAdapter.createFromResource(view.getContext(),R.array.game_kind, android.R.layout.simple_spinner_item);
gameKindArray.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
gameKind.setAdapter(gameKindArray);
但是如果是这样:
String[] test=new String[]{"test1","test2"};
怎么改变String[]
到ArrayAdapter
?