What do you want to save?
Add Code snippet
New code examples
-
Kotlin 2022-03-07 04:30:37
spring boot kotlin
@RunWith(SpringRunner::class) @SpringBootTest(classes = arrayOf(KotlinDemoApplication::class), webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) class KotlinDemoApplicationTests { @Autowired lateinit var testRestTemplate: TestRestTem... Add solution -
Java 2022-02-12 05:40:02
kotlin android intent pass data
//Send value from HomeActivity val intent = Intent(this@HomeActivity,ProfileActivity::class.java) intent.putExtra("Username","John Doe") startActivity(intent) //Get values in ProfileActivity val profileName=intent.getStringExtra(&qu... Add solution -
Other 2021-11-20 08:24:12
replace ViewModelProviders.of
JAVA replace : customViewModel = ViewModelProviders.of(this).get(CustomViewModel.class); with: customViewModel = new ViewModelProvider(this).get(CustomViewModel.class); KOTLIN replace: customViewModel = ViewModelProviders.of(this).get(CustomVi... Add solution -
Other 2021-11-10 21:01:21
kotlin hashmap to object
Ok I found the solution I transformed my Bundle class in a data class : data class Bundle( var version: String? = null, var app: String? = null, var countries: ArrayList<Any> = arrayListOf(), var currency: HashMap<String, Any>... Add solution -
Other 2021-11-08 01:05:19
viewmodelproviders is deprecated
JAVA replace : customViewModel = ViewModelProviders.of(this).get(CustomViewModel.class); with: customViewModel = new ViewModelProvider(this).get(CustomViewModel.class); KOTLIN replace: customViewModel = ViewModelProviders.of(this).get(CustomVi... Add solution -
Other 2021-11-02 09:33:13
restart service ondestroy android
AppLog.i("System UI Service is Restarting") val startSystemUiIntent = Intent(context, AwesomeService::class.java) val restartServicePendingIntent = PendingIntent.getService(context, 1, startSystemUiIntent, PendingIntent.F... Add solution -
Other 2021-10-28 16:28:12
open new activity using login form android kotlin
import android.content.Intent import androidx.appcompat.app.AppCompatActivity import android.os.Bundle import android.widget.Button import android.widget.EditText import android.widget.Toast class MainActivity2 : AppCompatActivity() { override fun o... Add solution