What do you want to save?
Add Code snippet
New code examples
-
Java 2021-10-06 17:17:07
how to open soft keyboard in android programmatically
class MainActivity: AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_message) val editTextMessage = findViewById<EditText>(R.id.myEdit... Add solution -
Java 2021-10-05 23:05:01
java get location of jar file
//this worked for me File jarDir = new File(ClassLoader.getSystemClassLoader().getResource(".").toURI()); //this didn't work for me but it is often suggested File jar = new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().... Add solution -
Java 2021-09-25 15:49:02
create notification android
package com.example.notificationdemo; import android.app.Activity; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; import android.content.Intent; import android.support.v4.app.NotificationCompat; ... Add solution -
Kotlin 2021-09-25 03:18:06
get list of current open apps in kotlin
val am = getSystemService(Context.ACTIVITY_SERVICE) as ActivityManager val runningAppProcessInfo = am.runningAppProcesses // detect an app for (i in runningAppProcessInfo.indices) { if (runningAppProcessInfo[i].processName == "com.the.app.yo... Add solution -
Java 2021-09-24 18:40:03
java get jar path
//this worked for me File jarDir = new File(ClassLoader.getSystemClassLoader().getResource(".").toURI()); //this didn't work for me but it is often suggested File jar = new File(MyClass.class.getProtectionDomain().getCodeSource().getLocation().... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5