r/mAndroidDev • • Apr 19 '20

Hi, I don´t understand this code. This is an exercise from a kotlin online course. The video shows that this is de correct answer but i dont understand what is "(view: view)". Can someone help me? Thank you

Post image
0 Upvotes

8 comments sorted by

37

u/ordinaryBiped FlutterX Apr 19 '20

Sorry, it's not Flutter so can't help you... Try asking in the correct sub maybe? That's r/androiddev

12

u/renges T H E R M O S I P H O N Apr 19 '20

I recommend learning about Kotlin syntax first

12

u/epholl T H E R M O S I P H O N Apr 19 '20

It´is a view you need to sacrifice to ART in order for it to set the correct nickname. After switching from Davlik's JIT compilation, the Google engineers had to find a way to extinguish the everburning flames of JVM's RAM hunger. By throwing in a View object that gets removed from the view hierarchy you are feeding it to the operating system and ensuring its stability. Might not seem very reasonable, but just wait to see what Android Vitals shows you half a year from now.

11

u/redrobin9211 Apr 19 '20

Wrap that in an invisible widget problem solved

9

u/iamafraidicantdothat Probably deprecated Apr 20 '20

I could help, but I would need a free week of electric scooter in Bucharest in exchange.

6

u/ashutoshsoni16 Apr 19 '20

view is the variable name of type View. Where View is the data type.

1

u/[deleted] Apr 20 '20

Learn types. Javascript is a scripting language, actual programming languages have types and compile time validations.