本文整理汇总了Java中org.holoeverywhere.widget.ArrayAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ArrayAdapter类的具体用法?Java ArrayAdapter怎么用?Java ArrayAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrayAdapter类属于org.holoeverywhere.widget包,在下文中一共展示了ArrayAdapter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreateView
import org.holoeverywhere.widget.ArrayAdapter; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
mDrawerListView = (ListView) inflater.inflate(
R.layout.fragment_navigation_drawer, container, false);
mDrawerListView.setOnItemClickListener(new android.widget.AdapterView.OnItemClickListener() {
@Override
public void onItemClick(android.widget.AdapterView<?> parent, View view, int position, long id) {
selectItem(position);
}
});
mDrawerListView.setAdapter(new ArrayAdapter<String>(
getSupportActionBar().getThemedContext(),
android.R.layout.simple_list_item_1,
android.R.id.text1,
new String[]{
getString(R.string.title_section1),
getString(R.string.title_section2),
getString(R.string.title_section3),
}));
mDrawerListView.setItemChecked(mCurrentSelectedPosition, true);
return mDrawerListView;
}
示例2: onPostExecute
import org.holoeverywhere.widget.ArrayAdapter; //导入依赖的package包/类
@Override
protected void onPostExecute(List<String> result) {
if (getActivity() == null)
return;
if(result != null)
settings.edit().putString("klassen", new Gson().toJson(result)).commit();
else
result = new Gson().fromJson(settings.getString("klassen", null), new TypeToken<List<String>>(){}.getType());
result.add(0, "Alle");
klasse = settings.getString("klasse", "");
klassen.setAdapter(new ArrayAdapter<String>(getActivity(), android.R.layout.simple_spinner_dropdown_item, result));
for(int i=0; i < klassen.getAdapter().getCount(); i++) {
if(klassen.getAdapter().getItem(i).toString().equals(klasse)){
klassen.setSelection(i);
break;
}
}
}
示例3: refresh
import org.holoeverywhere.widget.ArrayAdapter; //导入依赖的package包/类
@Override
public void refresh() {
ArrayAdapter adapter;
if ((adapter = (ArrayAdapter)this.getListAdapter()) != null) {
adapter.notifyDataSetChanged();
}
}
示例4: refreshList
import org.holoeverywhere.widget.ArrayAdapter; //导入依赖的package包/类
private void refreshList() {
ArrayAdapter adapter;
if ((adapter = (ArrayAdapter) this.getListAdapter()) != null) {
adapter.notifyDataSetChanged();
}
}