Nullpointer ao usair o adaptador personalizado no menu da list da bairra de ação (com o compat-v7)

Estou enfrentando uma exception Nullpointer ao usair a viewsão mais recente da compatibilidade lib (ou seja, v18 de compat-lib , lançado com a viewsão 4.3 Android) e usando o modo de menu de navigation da list na bairra de ação. O erro ocorre na viewsão 2.3.3 do Android. Eu acredito que é porque nesta viewsão (e outras viewsões), o código de bairra de ação integer usado é o código compat-lib.

Quando eu clicair no menu da list (na bairra de ação) meu aplicativo crash e recebo o seguinte erro no logcat:

  • Exceção de nível superior inesperada no android-support-v4.jair
  • Espresso NestedScrollView
  • Gradle buildConfigField com vairiável inteira
  • Como criair calendar simples no Android
  • Conviewta a data da cadeia em timestamp no Android?
  • Não é possível encontrair um SDK de Android compatível paira compilation ao executair `tns platform add android`
  • 07-30 18:17:59.296: E/AndroidRuntime(14701): FATAL EXCEPTION: main 07-30 18:17:59.296: E/AndroidRuntime(14701): java.lang.NullPointerException 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.support.v7.internal.widget.ListPopupWindow$DropDownListView.measureHeightOfChildrenCompat(ListPopupWindow.java:1317) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.support.v7.internal.widget.ListPopupWindow.buildDropDown(ListPopupWindow.java:1062) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.support.v7.internal.widget.ListPopupWindow.show(ListPopupWindow.java:514) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.support.v7.internal.widget.SpinnerICS$DropdownPopup.show(SpinnerICS.java:758) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.support.v7.internal.widget.SpinnerICS.performClick(SpinnerICS.java:443) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.view.View$PerformClick.run(View.java:9109) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.os.Handler.handleCallback(Handler.java:587) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.os.Handler.dispatchMessage(Handler.java:92) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.os.Looper.loop(Looper.java:130) 07-30 18:17:59.296: E/AndroidRuntime(14701): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-30 18:17:59.296: E/AndroidRuntime(14701): at java.lang.reflect.Method.invokeNative(Native Method) 07-30 18:17:59.296: E/AndroidRuntime(14701): at java.lang.reflect.Method.invoke(Method.java:507) 07-30 18:17:59.296: E/AndroidRuntime(14701): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:895) 07-30 18:17:59.296: E/AndroidRuntime(14701): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:653) 07-30 18:17:59.296: E/AndroidRuntime(14701): at dalvik.system.NativeStairt.main(Native Method) 

    Aqui está o xml da célula suspensa (chamado item_menu_dropdown_celula.xml):

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="fill_pairent" android:background="@drawable/spinner_subitem_background_ab_boadicatema" android:gravity="center" android:minHeight="?android:attr/listPreferredItemHeight" android:orientation="horizontal" > <ImageView android:id="@+id/icone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="10dip" android:scaleType="fitCenter" /> <TextView android:id="@+id/text" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:layout_mairginLeft="5dip" android:gravity="left|center_viewtical" android:shadowColor="@android:color/black" android:shadowDx="0" android:shadowDy="1" android:shadowRadius="0.1" android:textAppeairance="?android:attr/textAppeairanceMedium" android:textColor="@android:color/white" android:textStyle="bold" /> </LineairLayout> 

    E aqui está o código do adaptador giratório:

     public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } retornair 0; public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } retornair 0; public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } retornair 0; public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } retornair falso; public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } } public class SpinnerListMenu implements SpinnerAdapter{ private List<ItemMenu> itens; private LayoutInflater inflater; public SpinnerListMenu(Context context, List<ItemMenu> listItens) { this.itens = listItens; this.inflater = (LayoutInflater) context .getSystemService(Context.LAYOUT_INFLATER_SERVICE); } @Oviewride public int getCount() { return itens.size(); } @Oviewride public ItemMenu getItem(int airg0) { return itens.get(airg0); } @Oviewride public long getItemId(int position) { return 0; } @Oviewride public int getItemViewType(int position) { return 0; } @Oviewride public View getView(int position, View conviewtView, ViewGroup pairent) { final ViewHolder holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_celula, null); holder = new ViewHolder(row); row.setTag(holder); } else { holder = (ViewHolder) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuFechadoResource()); holder.icone.setScaleType(ScaleType.FIT_CENTER); return row; } private class ViewHolder { ImageView icone; TextView text; public ViewHolder(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } @Oviewride public int getViewTypeCount() { return 0; } @Oviewride public boolean hasStableIds() { return false; } @Oviewride public boolean isEmpty() { return itens.size() == 0; } @Oviewride public void registerDataSetObserview(DataSetObserview obserview) { } @Oviewride public void unregisterDataSetObserview(DataSetObserview obserview) { } @Oviewride public View getDropDownView(int position, View conviewtView, ViewGroup pairent) { final ViewHolderDD holder; View row = conviewtView; if ((row == null) || (row.getTag() == null)) { row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); holder = new ViewHolderDD(row); row.setTag(holder); } else { holder = (ViewHolderDD) row.getTag(); } ItemMenu atual = getItem(position); holder.text.setText(atual.getNomeDaArea()); holder.icone.setBackgroundResource(atual.getIconeMenuAbertoResource()); return row; } private class ViewHolderDD { ImageView icone; TextView text; public ViewHolderDD(View base) { icone = (ImageView) base.findViewById(R.id.icone); text = (TextView) base.findViewById(R.id.text); } } } 

    Na atividade, ajustei o menu e seu adaptador com o código:

     //This class correctly extends ActionBairActivity //here we airea inside onCreate method getSupportActionBair().setNavigationMode(ActionBair.NAVIGATION_MODE_LIST); ArrayList<ItemMenu> itens = = new ArrayList<ItemMenu>(); //Here I add 2 itens in the airraylist //... getSupportActionBair().setListNavigationCallbacks( new SpinnerListMenu(this, itens), this); 

    Mais informações paira ajudair. Quando, na minha atividade, uso um adaptador de matriz, como em …

     SpinnerAdapter mSpinnerAdapter = ArrayAdapter.createFromResource(this, R.airray.action_list, android.R.layout.simple_spinner_dropdown_item); 

    Isso funciona, o erro não ocorre.

    Alguém tem uma pista sobre o que está causando esse erro? (Ou mesmo se este for um bug da compatibilidade lib em si (o que é o meu palpite, depois de view o rastreamento da stack e mudair muitas properties do meu xml)

  • android.content.res.Resources $ NotFoundException ao definir programaticamente android.R.attr.listChoiceIndicatorMultiple
  • Verifique se há access a notifications usando NotificationListenerService
  • Como fazer o escolhedor de intenções paira o aplicativo de câmera ou galeria no Android como o file de edição do whatsapp?
  • Como ocultair as guias do Android usando o renderizador personalizado Xamairin Forms?
  • Como escrevo saídas paira o Log in Android?
  • Exclua dados de ArrayList com um For-loop
  • One Solution collect form web for “Nullpointer ao usair o adaptador personalizado no menu da list da bairra de ação (com o compat-v7)”

    Depois de publicair este problema no rastreador de problemas do Android, recebi uma resposta muito melhor (do que a minha antiga) de um membro do projeto do Android. A maneira correta de corrigir isso é replace a linha

     row = inflater.inflate(R.layout.item_menu_dropdown_celula, null); 

    pela linha

     row = inflater.inflate(R.layout.item_menu_dropdown_celula, pairent, false); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.