title: Use lambda expression to create an AlertDialog
body: <p>I have my Android studio set with these:</p>
  
  <pre><code>    classpath "me.tatarka:gradle-retrolambda:3.2.2"
      classpath 'me.tatarka.retrolambda.projectlombok:lombok.ast:0.2.3.a2'
  </code></pre>
  
  <p>And I am trying to use lambdas to know what I can do or not. </p>
  
  <p>When I did the following code:</p>
  
  <pre><code>    alertDialogBuilder.setPositiveButton("Okay", new DialogInterface.OnClickListener() {
          @Override
          public void onClick(DialogInterface dialog, int which) {
              dialog.cancel();
          }
      });
  </code></pre>
  
  <p>The IDE grayed out the <code>new DialogInterface.OnClickListener()</code> telling me it could be replaced with a lambda. Nothing more or less. After looking into <a href="http://marksunghunpark.blogspot.com.br/2015/05/lets-start-lambda-in-android.html" rel="nofollow"><strong>several</strong></a> <a href="https://www.reddit.com/r/androiddev/comments/2iokwh/retrolambda_java_8_lambda_syntax_when_an/" rel="nofollow"><em>examples</em></a>. I tried things like:</p>
  
  <pre><code>    alertDialogBuilder.setPositiveButton("Okay", (DialogInterface dialog) -&gt; {
              dialog.cancel();
      });
  </code></pre>
  
  <p>Also these:</p>
  
  <pre><code>alertDialogBuilder.setNegativeButton((DialogInterface) d -&gt; d.cancel());
  </code></pre>
  
  <p>Among the errors:</p>
  
  <blockquote>
    <p>Error:(99, 64) error: incompatible types: DialogInterface is not a functional interface
    multiple non-overriding abstract methods found in interface DialogInterface</p>
  </blockquote>
  
  <p>How should I use lambda in this case?</p>