andfix不支持在被修改的bug的方法里调用父类的方法吗?

1wnzp6jl  于 4个月前  发布在  其他
关注(0)|答案(5)|浏览(64)

在被修改的方法里调用父类的方法,会报调用的那个父类方法找不到的错误 @supern

nom7f22z

nom7f22z1#

@weijunfeng 支持的啊

dldeef67

dldeef672#

E/AndroidRuntime: FATAL EXCEPTION: main
   Process: andfix.euler.com.andfixdemo, PID: 8549
   java.lang.NoSuchMethodError: No virtual method getActivity()Lcom/euler/andfix/BaseActivity; in class Lcom/euler/andfix/MainActivity_CF; or its super classes (declaration of 'com.euler.andfix.MainActivity_CF' appears in /data/user/0/andfix.euler.com.andfixdemo/files/apatch/out.apatch)
       at com.euler.andfix.MainActivity_CF.show(MainActivity.java:47)
       at com.euler.andfix.MainActivity.onCreate(MainActivity.java:43)
       at android.app.Activity.performCreate(Activity.java:6323)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2385)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2492)
       at android.app.ActivityThread.access$900(ActivityThread.java:153)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1358)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:148)
       at android.app.ActivityThread.main(ActivityThread.java:5458)
       at java.lang.reflect.Method.invoke(Native Method)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)


public class BaseActivity extends Activity {
    public BaseActivity getActivity(){
        return this;
    }
}

public class MainActivity extends BaseActivity {
    private static final String TAG = "euler";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.e(TAG, A.a("good"));
        Log.e(TAG, "" + new A().b("s1", "s2"));
        Log.e(TAG, "" + new A().getI());
        show();
    }
    private void  show(){
//      new A().toast(this);
        new A().toast(getActivity());// 被修复的地方
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        android.os.Process.killProcess(android.os.Process.myPid());
    }

}

这样会报错的 @supern

9w11ddsr

9w11ddsr3#

@weijunfeng 我也遇到这个问题了,解决了吗?
@supern 怎么支持呢?

j8ag8udp

j8ag8udp4#

我也遇到了,换回0.4.0就可以了

0mkxixxg

0mkxixxg5#

0.5.0版本同遇到这个问题
只好将 版本降回0.4.1

相关问题