android - Anonymous class can be replaced with lambda hint -
i use library build dialogs: https://github.com/afollestad/material-dialogs/
i'm getting hint
anonymous new materialdialog.singlebuttoncallback() can replaced lambda hint.
since update android studio 2.4 prev 4, shows me issue:
here code:
public void swapconfirm() { materialdialog dialog = new materialdialog.builder(this) .title(r.string.swap_teams) .content(r.string.swap_confirm) .positivetext(r.string.swap_teams) .negativetext(android.r.string.cancel) .onpositive(new materialdialog.singlebuttoncallback() { @override public void onclick(@nonnull materialdialog dialog, @nonnull dialogaction which) { swapteams(""); } }).build(); dialog.show(); }
how can change new lambda schema?
i tried following according this blog post, not work:
as error variable dialog
defined in scope change it's name dialog1
example , should work.
this error won't happen if let android studio convert anonymous class lambda clicking alt+ener
, choose first choice intention list.
Comments
Post a Comment