Skip to content

Instantly share code, notes, and snippets.

View joecks's full-sized avatar

joecks

  • Flutter & Android Freelancer
  • Berlin
View GitHub Profile
@dodyg
dodyg / gist:5823184
Last active March 29, 2024 03:59
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@joecks
joecks / showFlags(Intent intent)
Created January 17, 2013 20:16
Prints all flags of an Android Intent, which is very useful for debugging Intents!
Field[] declaredFields = Intent.class.getDeclaredFields();
for (Field field : declaredFields) {
if (field.getName().startsWith("FLAG_")) {
try {
int flag = field.getInt(null);
if ((intent.getFlags() & flag) != 0) {
log.d(field.getName());
}