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: enter image description here

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:enter image description here

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

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -