title: Class must either be declared abstract or implement abstract method
body: <p>I have found a mini Deezer player on github, but I think it's been coded in Eclipse. I however work in Android Studio.</p>
  
  <p>Beeing my first Android app it must be a noob question, but I am stuck on this:</p>
  
  <pre><code>private DialogListener mDeezerDialogListener = new **DialogListener**() {
  
              @Override
              public void onComplete(Bundle values) {
                  // store the current authentication info 
                  SessionStore sessionStore = new SessionStore();
                  sessionStore.save(mDeezerConnect, LoginActivity.this);
  
                  // Launch the Home activity
                  Intent intent = new Intent(LoginActivity.this, HomeActivity.class);
                  startActivity(intent);
              }
  
              @Override
              public void onDeezerError(final DeezerError deezerError) {
                  Toast.makeText(LoginActivity.this, R.string.deezer_error_during_login,
                          Toast.LENGTH_LONG).show();
              }
  
              @Override
              public void onError(final DialogError dialogError) {
                  Toast.makeText(LoginActivity.this, R.string.deezer_error_during_login,
                          Toast.LENGTH_LONG).show();
              }
  
              @Override
              public void onCancel() {
                  Toast.makeText(LoginActivity.this, R.string.login_cancelled, Toast.LENGTH_LONG).show();
              }
  
              @Override
              public void onOAuthException(OAuthException oAuthException) {
                  Toast.makeText(LoginActivity.this, R.string.invalid_credentials, Toast.LENGTH_LONG)
                          .show();
              }
          };`
  </code></pre>
  
  <p>The <strong>bold function</strong> is giving me an error which reads:</p>
  
  <blockquote>
    <p>Class 'Anonymous class derived from DialogListener' must either be
    declared abstract or implement abstract method
    'onException(Exception)' in 'DialogListener'.</p>
  </blockquote>
  
  <p>I have no idea what is the problem, but to add insult to injury, all is well with the first @Override, but the second, the third and the last one give me this error:</p>
  
  <blockquote>
    <p>Error:(91, 17) error: method does not override or implement a method
    from a supertype</p>
  </blockquote>
  
  <p>This is supposed to be a working code snippet, so what is the problem here, why the complaints on some of the @Overrides?</p>
  
  <p>Are those two errors connected?</p>
  
  <p>EDIT1:</p>
  
  <p>As suggested I added another function:</p>
  
  <pre><code>@Override
              public void onException(Exception exception) {
  
              }
  </code></pre>
  
  <p>and the first error went away. Could it be that the original code on github was written for a previous version of SDK, that did stuff diferently?</p>
  
  <p>@Override errors stayed. but as far as I can see, those are sub-exceptions of onException?</p>
  
  <p>EDIT2:</p>
  
  <p>This is defined in the Deezer SDK: </p>
  
  <pre><code>import com.deezer.sdk.network.connect.event.DialogListener; 
  </code></pre>
  
  <p>I am looking at their documentation and it mentions under "Method Summary": 
  <code>onCancel()</code>, 
  <code>onComplete(Bundle values)</code>, 
  <code>onException(Exception exception)</code>. </p>
  
  <p>It also says: 
  <code>void onException(Exception exception)</code> is called when an exception is thrown during the authentication process. </p>
  
  <p>The following exceptions may be raised : 
  <code>OAuthException</code>, 
  <code>DeezerError</code>, 
  <code>DialogError</code>. </p>
  
  <p>I think I will post all additional data here.</p>
  
  <p>EDIT3:</p>
  
  <p>This is how I rewrote the code:</p>
  
  <pre><code>@Override
      public void onException(Exception exception) {
  
          if(exception instanceof DeezerError){
              Toast.makeText(LoginActivity.this, R.string.deezer_error_during_login,
                      Toast.LENGTH_LONG).show();
          }
          else if(exception instanceof DialogError){
              Toast.makeText(LoginActivity.this, R.string.deezer_error_during_login,
                      Toast.LENGTH_LONG).show();    
          }
          else if(exception instanceof OAuthException){
              Toast.makeText(LoginActivity.this, R.string.invalid_credentials, Toast.LENGTH_LONG)
                      .show();    
          }
          else{
              //not implemented?
          }
  
      }
  </code></pre>
  
  <p>Gives a warning: <code>Condition 'exception instanceof OAuthException' is always 'false'</code>.</p>
  
  <p>I will have to work on that, but this is now a different question.</p>