evant / gradle-retrolambda

A gradle plugin for getting java lambda support in java 6, 7 and android
Apache License 2.0
5.3k stars 449 forks source link

AlertDialog OnClickListener not triggered #266

Closed eric-grab closed 6 years ago

eric-grab commented 6 years ago

the issue is only happening on certain devices e.g. Nexus 5 Emulator API 24

on those devices, the following does not work: SomeActivity.java

final AlertDialog.Builder builder = new AlertDialog.Builder(this);
                          builder.setPositiveButton(R.string.btn_im_ready, (dialogInterface, i) -> {
                    doSomething();// Not called!
                });
                builder.create().show();

Interestingly, this works: SomeActivity.java

final AlertDialog.Builder builder = new AlertDialog.Builder(this);
                          builder.setPositiveButton(R.string.btn_im_ready, (dialogInterface, i) -> {
                    SomeActivity.this.doSomething();// this is called!
                });
                builder.create().show();

Anyone with any ideas?

evant commented 6 years ago

Sounds like a potential retrolamda issue, make sure you are using the latest version and see if you can reproduce in a sample project. Having the outputed bytecode would also help.

eric-grab commented 6 years ago

My bad, it's our own issue, closing