title: Dialog show error
body: <p>I'm having problems showing this Dialog on a onClick of a cardView. Yesterday was working but today it fails. </p>
  
  <p><strong>I SOLVED THE PROBLEM WAS I WAS CALLING MY ADAPTER WITH 
  MyAdapter(getActivity().getAplicationContext, getDocumentList()); insted of MyAdapter(getActivity(), getDocumentList());</strong></p>
  
  <p>This is the code of the alerDialog.</p>
  
  <pre><code>    private void createDialogServices(final int position) {
      AlertDialog.Builder builderSingle = new AlertDialog.Builder(context);
      builderSingle.setIcon(R.drawable.ic_work_black);
      builderSingle.setTitle("¿Qué oficio desempeñas?");
  
      final ArrayAdapter&lt;String&gt; arrayAdapter = new ArrayAdapter&lt;&gt;(context, android.R.layout.select_dialog_singlechoice);
  
      GetOficiosFromServer.getAllWorks(context, new GetOficiosFromServer.VolleyCallBack() {
          @Override
          public void onSuccess(ArrayList&lt;String&gt; oficios) {
              for (String profesion : oficios) {
                  arrayAdapter.add(profesion);
                  //Toast.makeText(context, profesion, LENGTH_LONG).show();
              }
          }
          @Override
          public void onFail(String msg) {
              Toast.makeText(context, "Error al recuperar información", LENGTH_LONG).show();
          }
      });
  
      builderSingle.setNegativeButton("cancel", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
              dialog.dismiss();
          }
      });
      builderSingle.setAdapter(arrayAdapter, new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
              String strName = arrayAdapter.getItem(which);
              //onSelectOficio(position, strName);
          }
      });
      builderSingle.show();
  }
  </code></pre>
  
  <p>And above the code of the Adapter of my RecyclerView</p>
  
  <pre><code>public class MyAdapter extends RecyclerView.Adapter&lt;RecyclerView.ViewHolder&gt; {
  
  private static final int TYPE_HEADER = 0;
  private static final int TYPE_ITEM = 1;
  private static final int TYPE_FOOTER = 2;
  private HeaderViewHolder headerHolder;
  
  
  private ArrayList&lt;Doc&gt; documentos;
  private Context context;
  
  public MyAdapter(Context context, ArrayList&lt;Doc&gt; generics) {
      this.context = context;
      this.documentos = generics;
  }
  
  
  
  @Override
  public RecyclerView.ViewHolder onCreateViewHolder (ViewGroup parent, int viewType) {
      if(viewType == TYPE_HEADER) {
          View v = LayoutInflater.from (parent.getContext ()).inflate (R.layout.card_header, parent, false);
          return new HeaderViewHolder (v);
      } else if(viewType == TYPE_FOOTER) {
          View v = LayoutInflater.from (parent.getContext ()).inflate (R.layout.card_foter, parent, false);
          return new FooterViewHolder (v);
      } else if(viewType == TYPE_ITEM) {
          View v = LayoutInflater.from (parent.getContext ()).inflate (R.layout.card_item, parent, false);
          return new GenericViewHolder (v);
      }
      return null;
  }
  
  private Doc getItem (int position) {
      return documentos.get (position);
  }
  
  
  @Override
  public void onBindViewHolder (RecyclerView.ViewHolder holder, final int position) {
      if(holder instanceof HeaderViewHolder) {
          headerHolder = (HeaderViewHolder) holder;
          headerHolder.card_view_header.setOnClickListener (new View.OnClickListener () {
              @Override
              public void onClick (View view) {
                  Toast.makeText (context, "Clicked Header " + position, Toast.LENGTH_SHORT).show ();
                  createDialogServices(position);
              }
          });
      } else if(holder instanceof FooterViewHolder) {
          FooterViewHolder footerHolder = (FooterViewHolder) holder;
          //footerHolder.txtTitleFooter.setText ("Footer");
          footerHolder.send_Button.setOnClickListener (new View.OnClickListener () {
              @Override
              public void onClick (View view) {
                  Toast.makeText (context, "Clicked Footer", Toast.LENGTH_SHORT).show ();
              }
          });
      } else if(holder instanceof GenericViewHolder) {
          Doc currentItem = getItem (position - 1);
          final Integer num = currentItem.getPosition();
          GenericViewHolder genericViewHolder = (GenericViewHolder) holder;
          genericViewHolder.txtTitle.setText(currentItem.getTittle());
          genericViewHolder.txtDescription.setText(currentItem.getPosition().toString());
          genericViewHolder.txtTitle.setOnClickListener (new View.OnClickListener () {
              @Override
              public void onClick (View view) {
                  Toast.makeText (context, "Clicked item" + (num), Toast.LENGTH_SHORT).show ();
              }
          });
      }
  }
  //    need to override this method
  @Override
  public int getItemViewType (int position) {
      if(isPositionHeader (position)) {
          return TYPE_HEADER;
      } else if(isPositionFooter (position)) {
          return TYPE_FOOTER;
      }
      return TYPE_ITEM;
  }
  
  private boolean isPositionHeader (int position) {
      return position == 0;
  }
  
  private boolean isPositionFooter (int position) {
      return position == documentos.size () + 1;
  }
  
  @Override
  public int getItemCount () {
      return documentos.size () + 2;
  }
  
  private class FooterViewHolder extends RecyclerView.ViewHolder {
      Button send_Button;
      FooterViewHolder(View itemView) {
          super (itemView);
          this.send_Button = (Button) itemView.findViewById (R.id.btn_send_docs);
      }
  }
  
  
  
  private class HeaderViewHolder extends RecyclerView.ViewHolder {
      CardView card_view_header;
      TextView card_txt_title;
      TextView card_txt_description;
      HeaderViewHolder(View itemView) {
          super (itemView);
          this.card_view_header = (CardView) itemView.findViewById (R.id.card_view_header);
          this.card_txt_title = (TextView) itemView.findViewById(R.id.card_header_textView_tittle);
          this.card_txt_description = (TextView) itemView.findViewById(R.id.card_header_textView_description);
      }
  }
  
  private class GenericViewHolder extends RecyclerView.ViewHolder {
      TextView txtTitle;
      TextView txtDescription;
      GenericViewHolder(View itemView) {
          super(itemView);
          this.txtTitle = (TextView) itemView.findViewById(R.id.card_item_textView_tittle);
          this.txtDescription = (TextView) itemView.findViewById(R.id.card_item_textView_description);
      }
  }
  </code></pre>
  
  <p>This code use to work, but I add the footer and header to the RecyclerView and it really wasn't the problem because after that I remember that it works, but I was messing around with some classes of volleyrequests. I think is something of the context. I also test the same method on a Activity and works fine.</p>
  
  <p>The error that I'm gettins is this:</p>
  
  <pre><code> FATAL EXCEPTION: main
    Process: com.bim.tech.construbimapp, PID: 4504
    android.content.res.Resources$NotFoundException: Resource ID #0x0
        at android.content.res.Resources.getValue(Resources.java:1457)
        at android.content.res.Resources.loadXmlResourceParser(Resources.java:2904)
        at android.content.res.Resources.getLayout(Resources.java:1237)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:412)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
        at android.support.v7.app.AlertController$AlertParams.createListView(AlertController.java:966)
        at android.support.v7.app.AlertController$AlertParams.apply(AlertController.java:942)
        at android.support.v7.app.AlertDialog$Builder.create(AlertDialog.java:930)
        at android.support.v7.app.AlertDialog$Builder.show(AlertDialog.java:954)
        at com.bim.tech.construbimapp.helper.MyAdapter.createDialogServices(MyAdapter.java:208)
        at com.bim.tech.construbimapp.helper.MyAdapter.access$100(MyAdapter.java:29)
        at com.bim.tech.construbimapp.helper.MyAdapter$1.onClick(MyAdapter.java:75)
        at android.view.View.performClick(View.java:4848)
        at android.view.View$PerformClick.run(View.java:20262)
        at android.os.Handler.handleCallback(Handler.java:815)
        at android.os.Handler.dispatchMessage(Handler.java:104)
        at android.os.Looper.loop(Looper.java:194)
        at android.app.ActivityThread.main(ActivityThread.java:5637)
        at java.lang.reflect.Method.invoke(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:372)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:959)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:754)
  </code></pre>