title: How to resolve multiple onclicklistner that are using together
body: <p>This is my code and I can't solve this. I've been very confused from couple of days but the error does not disappear. I see an error in onClickListner and some other places. Please help me. </p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Collections;
  import java.util.Random;
  import android.app.Activity;
  import android.app.Dialog;
  import android.content.Context;
  import android.content.Intent;
   import android.graphics.Color;
    import android.graphics.Typeface;
   import android.media.MediaPlayer;
    import android.os.Bundle;
   import android.os.Handler;
    import android.view.View;
    import android.widget.Button;
    import android.widget.ImageView;
   import android.widget.ProgressBar;
   import android.widget.TextView;
   import android.view.View.OnClickListener;
       this.   OptionB.setOnClickListener(new View.OnClickListener(){
             @Override
          public void onClick(View arg0)
          {
              ArabicQuiz.this.OptionA.setEnabled(false);
              ArabicQuiz.this.OptionC.setEnabled(false);
            ArabicQuiz.this.OptionD.setEnabled(false);
            ArabicQuiz.this.temps.cancel();
            String str = ArabicQuiz.this.OptionB.getText().toString();
            if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(str))
            {
                ArabicQuiz localArabicQuiz = ArabicQuiz.this;
              localArabicQuiz.lavel = Integer.valueOf(1 + localArabicQuiz.lavel.intValue());
              ArabicQuiz.this.dynamiclevel = localArabicQuiz.lavel.intValue();
              ArabicQuiz.this.OptionB.setBackgroundResource(2130837504);
              ArabicQuiz.this.OptionB.setTextColor(-16777216);
              if (ArabicQuiz.mpright != null) {
                  ArabicQuiz.mpright.start();
              }
              ArabicQuiz.this.handler.postDelayed(new Runnable()
              {
                public void run()
                {
                    ArabicQuiz.this.OptionD.setEnabled(true);
                  ArabicQuiz.this.OptionC.setEnabled(true);
                  ArabicQuiz.this.OptionA.setEnabled(true);
                  ArabicQuiz.this.OptionB.setBackgroundResource(2130837507);
                  ArabicQuiz.this.OptionB.setTextColor(-1);
                  ArabicQuiz.this.kbc(ArabicQuiz.this.var4, ArabicQuiz.this.lavel.intValue());
                  ArabicQuiz.this.initCount();
                  ArabicQuiz.this.temps.start();
                }
              }, 5000L);
              return;
            }
            ArabicQuiz.this.OptionB.setBackgroundResource(2130837505);
            ArabicQuiz.this.OptionB.setTextColor(-16777216);
            ArabicQuiz.this.temps.cancel();
            if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionA.getText().toString()))
            {
                ArabicQuiz.this.OptionA.setBackgroundResource(2130837504);
              ArabicQuiz.this.OptionA.setTextColor(-16777216);
            }
            for (;;)
            {
              if (ArabicQuiz.mpwrong != null) {
                  ArabicQuiz.mpwrong.start();
              }
              ArabicQuiz.this.handler.postDelayed(new Runnable()
              {
                public void run()
                {
                  Intent localIntent = new Intent();
                  localIntent.putExtra("total", ArabicQuiz.this.min);
                  localIntent.putExtra("status", "Ø¢Ø³ÙØŒ Ø­Ø§ÙˆÙ„ Ù…Ø±Ø© Ø£Ø®Ø±Ù‰");
                  ArabicQuiz.this.finish();
                  ArabicQuiz.this.startActivity(localIntent.setClass(ArabicQuiz.this, End.class));
                }
              }, 5000L);
              return;
  
              if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionC.getText().toString()))
              {
                  ArabicQuiz.this.OptionC.setBackgroundResource(2130837504);
                ArabicQuiz.this.OptionC.setTextColor(-16777216);
              }
              else if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionD.getText().toString()))
              {
                  ArabicQuiz.this.OptionD.setBackgroundResource(2130837504);
                ArabicQuiz.this.OptionD.setTextColor(-16777216);
              }
            }
          }
        });
  
        this.OptionC.setOnClickListener(new View.OnClickListener()
        {
            @Override 
           public void onClick(View arg0)
          {
              ArabicQuiz.this.OptionB.setEnabled(false);
            ArabicQuiz.this.OptionA.setEnabled(false);
            ArabicQuiz.this.OptionD.setEnabled(false);
            ArabicQuiz.this.temps.cancel();
            String str = ArabicQuiz.this.OptionC.getText().toString();
            if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(str))
            {
                ArabicQuiz localArabicQuiz = ArabicQuiz.this;
              localArabicQuiz.lavel = Integer.valueOf(1 + localArabicQuiz.lavel.intValue());
              ArabicQuiz.this.dynamiclevel = localArabicQuiz.lavel.intValue();
              ArabicQuiz.this.OptionC.setBackgroundResource(2130837504);
              ArabicQuiz.this.OptionC.setTextColor(-16777216);
              if (ArabicQuiz.mpright != null) {
                  ArabicQuiz.mpright.start();
              }
              ArabicQuiz.this.handler.postDelayed(new Runnable()
              {
                public void run()
                {
                    ArabicQuiz.this.OptionB.setEnabled(true);
                  ArabicQuiz.this.OptionD.setEnabled(true);
                  ArabicQuiz.this.OptionA.setEnabled(true);
                  ArabicQuiz.this.OptionC.setBackgroundResource(2130837508);
                  ArabicQuiz.this.OptionC.setTextColor(-1);
                  ArabicQuiz.this.kbc(ArabicQuiz.this.var4, ArabicQuiz.this.lavel.intValue());
                  ArabicQuiz.this.initCount();
                  ArabicQuiz.this.temps.start();
                }
              }, 5000L);
              return;
            }
            ArabicQuiz.this.OptionC.setBackgroundResource(2130837505);
            ArabicQuiz.this.OptionC.setTextColor(-16777216);
            ArabicQuiz.this.temps.cancel();
            if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionB.getText().toString()))
            {
                ArabicQuiz.this.OptionB.setBackgroundResource(2130837504);
              ArabicQuiz.this.OptionB.setTextColor(-16777216);
            }
            for (;;)
            {
              if (ArabicQuiz.mpwrong != null) {
                  ArabicQuiz.mpwrong.start();
              }
              ArabicQuiz.this.handler.postDelayed(new Runnable()
              {
                public void run()
                {
                  Intent localIntent = new Intent();
                  localIntent.putExtra("total", ArabicQuiz.this.min);
                  localIntent.putExtra("status");
                  ArabicQuiz.this.finish();
                  ArabicQuiz.this.startActivity(localIntent.setClass(ArabicQuiz.this, End.class));
                }
              }, 5000L);
              return;
              if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionA.getText().toString()))
              {
                  ArabicQuiz.this.OptionA.setBackgroundResource(2130837504);
                ArabicQuiz.this.OptionA.setTextColor(-16777216);
              }
              else if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionD.getText().toString()))
              {
                  ArabicQuiz.this.OptionD.setBackgroundResource(2130837504);
                  ArabicQuiz.this.OptionD.setTextColor(-16777216);
              }
            }
          }
        });
        this.OptionD.setOnClickListener(new View.OnClickListener()
        {
            @Override
  
          public void onClick(View arg0)
          {
              ArabicQuiz.this.OptionB.setEnabled(false);
            ArabicQuiz.this.OptionC.setEnabled(false);
            ArabicQuiz.this.OptionA.setEnabled(false);
            ArabicQuiz.this.temps.cancel();
            String str = ArabicQuiz.this.OptionD.getText().toString();
            if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(str))
            {
                ArabicQuiz localArabicQuiz = ArabicQuiz.this;
              localArabicQuiz.lavel = Integer.valueOf(1 + localArabicQuiz.lavel.intValue());
              ArabicQuiz.this.dynamiclevel = localArabicQuiz.lavel.intValue();
              ArabicQuiz.this.OptionD.setBackgroundResource(2130837504);
              ArabicQuiz.this.OptionD.setTextColor(-16777216);
              if (ArabicQuiz.mpright != null) {
                  ArabicQuiz.mpright.start();
              }
              ArabicQuiz.this.handler.postDelayed(new Runnable()
              {
                public void run()
                {
                    ArabicQuiz.this.OptionB.setEnabled(true);
                  ArabicQuiz.this.OptionC.setEnabled(true);
                  ArabicQuiz.this.OptionA.setEnabled(true);
                  ArabicQuiz.this.OptionD.setBackgroundResource(2130837509);
                  ArabicQuiz.this.OptionD.setTextColor(-1);
                  ArabicQuiz.this.kbc(ArabicQuiz.this.var4, ArabicQuiz.this.lavel.intValue());
                  ArabicQuiz.this.initCount();
                  ArabicQuiz.this.temps.start();
                }
              }, 5000L);
              return;
            }
            ArabicQuiz.this.OptionD.setBackgroundResource(2130837505);
            ArabicQuiz.this.OptionD.setTextColor(-16777216);
            ArabicQuiz.this.temps.cancel();
            if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionB.getText().toString()))
            {
                ArabicQuiz.this.OptionB.setBackgroundResource(2130837504);
                ArabicQuiz.this.OptionB.setTextColor(-16777216);
            }
            for (;;)
            {
              if (ArabicQuiz.mpwrong != null) {
                  ArabicQuiz.mpwrong.start();
              }
              ArabicQuiz.this.handler.postDelayed(new Runnable()
              {
                public void run()
                {
                  Intent localIntent = new Intent();
                  localIntent.putExtra("total", ArabicQuiz.this.min);
                  localIntent.putExtra("status", ");
                  ArabicQuiz.this.finish();
                  ArabicQuiz.this.startActivity(localIntent.setClass(ArabicQuiz.this, End.class));
                }
              }, 5000L);
              return;
              if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionC.getText().toString()))
              {
                  ArabicQuiz.this.OptionC.setBackgroundResource(2130837504);
                  ArabicQuiz.this.OptionC.setTextColor(-16777216);
              }
              else if (((Question)ArabicQuiz.this.var4.get(ArabicQuiz.this.index.intValue())).getAns().equalsIgnoreCase(ArabicQuiz.this.OptionA.getText().toString()))
              {
                  ArabicQuiz.this.OptionA.setBackgroundResource(2130837504);
                  ArabicQuiz.this.OptionA.setTextColor(-16777216);
              }
            }
          }
        });
        this.imgFivtyFivty.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
              ArabicQuiz.this.lifeLineFivtyFivty();
          }
        });
        this.imgPhoneAFriend.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
              ArabicQuiz.this.loadPhoneAFriend();
          }
        });
        this.imgAudiancePoll.setOnClickListener(new View.OnClickListener()
        {
          public void onClick(View paramAnonymousView)
          {
           ArabicQuiz.this.lifeLineAudiancePoll();
          }
        });
        return;
      }
      catch (Exception localException) {}
  
  
    protected void onPause()
    {
      super.onPause();
      this.temps.pause();
    }
  
    protected void onResume()
    {
      super.onResume();
      this.temps.start();
    }
  }
  </code></pre>