Search code examples
javaandroidandroid-alertdialogbytecodedecompiler

Completing decompiled code


I have the following section of code. What method is supposed to be in the place of local 36?

   public void Alert()
  {
    AlertDialog.Builder localBuilder1 = new AlertDialog.Builder(this);
    AlertDialog.Builder localBuilder2 = localBuilder1.setMessage("You lost").setCancelable(false);
    36 local36 = new DialogInterface.OnClickListener()
    {
      public void onClick(DialogInterface paramDialogInterface, int paramInt)
      {
        paramDialogInterface.cancel();
        Pokemon.this.setContentView(2130903046);
        Pokemon.this.mainmenu();
      }
    };
    AlertDialog.Builder localBuilder3 = localBuilder2.setPositiveButton("OK", local36);
    AlertDialog localAlertDialog = localBuilder1.create();
    this.alert = localAlertDialog;
    this.alert.show();
  }

Solution

  • I expect that the original code looked something like this:

    AlertDialog.Builder localBuilder3 =
      localBuilder2.setPositiveButton
      (
        "OK",
        new DialogInterface.OnClickListener()
        {
          public void onClick(DialogInterface paramDialogInterface, int paramInt)
          {
            paramDialogInterface.cancel();
            Pokemon.this.setContentView(2130903046);
            Pokemon.this.mainmenu();
          }
        }
      );
    

    rather than having two separate statements. So the 36 wasn't in the original code; it represents the name of the anonymous inner class.