【问题标题】:Completing decompiled code完成反编译代码
【发布时间】:2012-03-15 22:50:28
【问题描述】:

我有以下代码部分。应该用什么方法代替本地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();
  }

【问题讨论】:

  • ...OnClickListener 应该在36 的位置;你是这个意思吗?

标签: java android android-alertdialog bytecode decompiler


【解决方案1】:

我希望原始代码看起来像这样:

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();
      }
    }
  );

而不是有两个单独的语句。所以36 不在原始代码中;它代表匿名内部类的名称。

【讨论】:

  • 非常感谢 - 我正在考虑隐藏类的方向,但不太了解它的工作方式。
猜你喜欢
  • 1970-01-01
  • 2011-09-30
  • 2019-09-20
  • 1970-01-01
  • 1970-01-01
  • 2014-05-29
  • 2015-12-21
  • 1970-01-01
  • 2013-04-01
相关资源
最近更新 更多