Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block shruti-basil-hs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Java-FindViewById
textView  = (TextView) findViewById(;
View Extension-functions
View.visible() {
this.visibility = View.Visible
View with-example
val w = Window()
with(w) {
View with-func-definition
fun <T, R> with(receiver: T, f: T.() -> R): R = receiver.f()
View apply-example
Person(name).apply { foo() };
//Equivalent 4 line Java code
Person getFoo(String name) {
Person person = new Person(name);;
return person;
View apply-func-description
fun <T> T.apply(f: T.() -> Unit): T { f(); return this }
View let-example
Person.getName().let { name ->
// name is no longer visible here
View KotlinNullSafety
class Person(var name: String?) // the name property can be null
class Person(var name: String) // the name property cannot be null
You can’t perform that action at this time.