What do you want to save?
Add Code snippet
New code examples in category Kotlin
-
Phoenix Logan 2022-02-02 20:51:54
kotlin string to bytes
"my string".toByteArray() Add solution -
Awgiedawgie 2022-02-01 02:21:02
kotlin coroutine actor
sealed class Msg object IncCounter: Msg() object PrintCounter: Msg() class GetCounter(val resp: CompletableDeferred<Int>):Msg() fun CoroutineScope.counterActor() = actor<Msg> { var counter = 0 // Actor state for (msg in channel) { when (msg... Add solution -
A-312 2022-01-30 13:05:16
hide keyboard android
public void hideKeyboard(Context context, View view) { InputMethodManager imm = (InputMethodManager) context.getSystemService(Activity.INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(view.getWindowToken(), 0); } // call from inside an Activity... Add solution -
Lionel Aguero 2022-01-28 16:26:30
kill other apps in kotlin
// add this permission to AndroidManifest.xml <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES"/> //and use this code to kill the process val am = getSystemService(Activity.ACTIVITY_SERVICE) as ActivityMana... Add solution -
A-312 2022-01-28 01:16:02
!! in kotlin
//The not-null assertion operator val l = b!!.length Add solution
Best helpers
Erwin
+5
Dr.khan
+5
Volker Kamin
+5
Akash Patel
+5
Bill Reason
+5
Sultan
+5
Rednryt
+5
GuitarFan
+5
Emdms
+5
Ljs
+5
Vlk
+5
Hrishioa
+5
Rpeinhardt
+5
Boehmi
+5
Bobby J
+5
Terry-s
+5
Mururoa
+5