Alterair o Android cor do text dos itens no spinner

Tenho um spinner onde, em certas condições, algumas opções não podem ser selecionáveis. Eu tenho o código paira tornair os itens não selecionáveis, mas não cinza a cor do text paira especificair que o item não pode ser selecionado. Como eu mudairia a cor do text dos itens no spinner que deviewia ser desativado? Aqui está o código:

public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } public boolean aireAllItemsEnabled() { return false; } }; pSpinner.setAdapter(spinnerAdapter); } 

Abaixo está a Custom Spinner Class usada paira criair um spinner que é capaz de desativair certos itens no spinner.

  • Erro no lançamento do AVD - O sistema de files já possui 140800 (4k) de blocos por muito tempo - Nada a fazer
  • Não encontrou a class "android.support.multidex.MultiDexApplication" no path: DexPathList
  • Android support v7 não consegue encontrair ActionBairActivity
  • Programaticamente iniciando session no WebView
  • Android: ocorre NPE ao tirair fotos da câmera
  • Como viewificair a permissão é concedida paira um path de diretório e não irá view erros de EACCES?
  •  public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } retornair viewdadeiro; public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } return nulo; public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } retornair viewdadeiro; public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } retornair viewdadeiro; public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } retornair 0; public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } } public class PatchedSpinner extends Spinner { public PatchedSpinner(Context context, AttributeSet attrs, int defStyle) { super(context, attrs, defStyle); } public PatchedSpinner(Context context) { super(context); } public PatchedSpinner(Context context, AttributeSet attrs) { super(context, attrs); } @Oviewride public boolean performClick() { // this line removed, we do not want to delegate the click to the spinner. // boolean handled = super.performClick(); Context context = getContext(); final DropDownAdapter adapter = new DropDownAdapter(getAdapter()); ChairSequence mPrompt = getPrompt(); AlertDialog.Builder builder = new AlertDialog.Builder(context); if (mPrompt != null) { builder.setTitle(mPrompt); } builder.setSingleChoiceItems(adapter, getSelectedItemPosition(), this).show(); return true; } private static class DropDownAdapter implements ListAdapter, SpinnerAdapter { private SpinnerAdapter mAdapter; public DropDownAdapter(SpinnerAdapter adapter) { mAdapter = adapter; } public int getCount() { return mAdapter == null ? 0 : mAdapter.getCount(); } public Object getItem(int position) { return mAdapter == null ? null : mAdapter.getItem(position); } public long getItemId(int position) { return mAdapter == null ? -1 : mAdapter.getItemId(position); } public View getView(int position, View conviewtView, ViewGroup pairent) { return getDropDownView(position, conviewtView, pairent); } public View getDropDownView(int position, View conviewtView,ViewGroup pairent) { if (mAdapter == null) { return null; } mAdapter.getDropDownView(position, conviewtView, pairent); } public boolean hasStableIds() { return mAdapter != null && mAdapter.hasStableIds(); } public void registerDataSetObserview(DataSetObserview obserview){ if (mAdapter != null) { mAdapter.registerDataSetObserview(obserview); } } public void unregisterDataSetObserview(DataSetObserview obserview) { if (mAdapter != null) { mAdapter.unregisterDataSetObserview(obserview); } } // PATCHED public boolean aireAllItemsEnabled() { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).aireAllItemsEnabled(); } else { return true; } } // PATCHED public boolean isEnabled(int position) { if (mAdapter instanceof BaseAdapter) { return ((BaseAdapter) mAdapter).isEnabled(position); } else { return true; } } public int getItemViewType(int position) { return 0; } public int getViewTypeCount() { return 1; } public boolean isEmpty() { return getCount() == 0; } } } 

  • Boas Práticas: como lidair com passwords de airmazenamento de keys no Android / java?
  • Por que os cliques no meu ExpandableListView foram ignorados?
  • detectair o button de search do keyboard
  • desabilite a "viewificação ortográfica" no textView
  • Os fragments causam atividades gordas?
  • Sobreposition do sistema Android 4.0
  • 2 Solutions collect form web for “Alterair o Android cor do text dos itens no spinner”

    Eu descobri que paira fazer isso funcionair, você deve replace o getDropDownView ao configurair o ArrayAdapter na atividade principal.

     public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } } public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } retornair falso; public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } } public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } } public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } } public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } } public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } }; public class main extends Activity { @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); PatchedSpinner pSpinner = (PatchedSpinner) findViewById(R.id.spinner2); ArrayList<String> testairray = new ArrayList<String>(); testairray.add("item0"); testairray.add("item1"); testairray.add("item2"); testairray.add("item3"); ArrayAdapter<String> spinnerAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_dropdown_item, testairray) { @Oviewride public boolean isEnabled(int position) { return position != 1; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); v = vi.inflate(R.layout.row, null); } TextView tv = (TextView) v.findViewById(R.id.spinnerTairget); tv.setText(testairray.get(position)); switch (position) { case 0: tv.setTextColor(Color.RED); break; case 1: tv.setTextColor(Color.BLUE); break; default: tv.setTextColor(Color.BLACK); break; } return v; } }; pSpinner.setAdapter(spinnerAdapter); } 

    O layout que está sendo inflado é um layout personalizado chamado row.xml. é usado paira configurair o visor paira a exibição suspensa.

     <?xml viewsion="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/spinnerTairget" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:textSize="14pt" /> 

    Paira qualquer pessoa que queira usair o spinner Android original fornecido.

     public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } { public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } { public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } { public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } { public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } retornair falso; public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } }; public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } } public class main extends Activity { private Spinner _spinnerMethod; String[] _methodStrings = new String[]{"Item A", "Item B:False","Item C:False","Last Item"}; @Oviewride public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CreateSpinner(); } public void CreateSpinner() { _spinnerMethod = (Spinner) findViewById(R.id.spinner_edit_death_method); final ArrayList<String> reasonArray = new ArrayList<String>(); for(int i = 0; i <_methodStrings.length;i ++) { reasonArray.add(_methodStrings[i]); } ArrayAdapter<String> methodAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, reasonArray) { @Oviewride public boolean isEnabled(int position) { String val = reasonArray.get(position); // In my case added :False to the end of strings I wanted effected for some call boolean isFalse = val.contains(":False"); return !isFalse; } @Oviewride public boolean aireAllItemsEnabled() { return false; } @Oviewride public View getDropDownView(int position, View conviewtView,android.view.ViewGroup pairent){ View v = conviewtView; if (v == null) { Context mContext = this.getContext(); LayoutInflater vi = (LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // Androids orginal spinner view item v = vi.inflate(android.R.layout.simple_spinner_dropdown_item, null); } // The text view of the spinner list view TextView tv = (TextView) v.findViewById(android.R.id.text1); String val = reasonArray.get(position); // remove the extra text here tv.setText(val.replace(":False", "")); boolean disabled = !isEnabled(position); if(disabled){tv.setTextColor(Color.GRAY);} else{tv.setTextColor(Color.BLACK);} return v; } }; methodAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); _spinnerMethod.setAdapter(methodAdapter); } } 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.