Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio doesn't show suggestion for lambda expression

I have added Java 8 compileOptions in app module

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
}

I also have checked "Anonymous type can be replaced with lambda" in Inspections/Java8 in Preferences

However the suggestion is never shown in Android Studio.

I am using Android Studio Arctic Fox | 2021.3.1 Patch 1

Any help would be appreciated.

like image 839
Hai Hack Avatar asked Sep 30 '26 12:09

Hai Hack


1 Answers

You should put the curso at lambda and in light bulb select "Enable option 'Implicit receivers and parameters' for 'Labdas' inlay hints" and solve your problem. view image

like image 119
elfer07 Avatar answered Oct 02 '26 01:10

elfer07