Skip to content

Instantly share code, notes, and snippets.

Contributing to open source

Victor Loveday Vicviral

Contributing to open source
View GitHub Profile
kobeumut / ObserveOnceExtension.kt
Created Apr 21, 2019
Android Livedata Observe Once Only (Kotlin)
View ObserveOnceExtension.kt
fun <T> LiveData<T>.observeOnce(lifecycleOwner: LifecycleOwner, observer: Observer<T>) {
observe(lifecycleOwner, object : Observer<T> {
override fun onChanged(t: T?) {
liveData.observeOnce(this, Observer<Password> {
Vicviral /
Created Sep 20, 2021 — forked from vadimTovstik/
How to download file to Internal Storage in Android
//in async task
// DownloadVideoAsyncTask async = new DownloadVideoAsyncTask(this);
// async.execute("");
public class DownloadVideoAsyncTask extends AsyncTask<String, Integer, String> {
private Context mContext;