Skip to content

Instantly share code, notes, and snippets.

@illuzor illuzor/WallpaperFragment.kt Secret
Created Sep 28, 2018

Embed
What would you like to do?
private fun setWallpaper() {
val dialog = ProgressDialog()
dialog.isCancelable = false
dialog.title = getString(R.string.setting_up_wallpaper)
dialog.show(fragmentManager, "")
runInBackground {
WallpaperManager.getInstance(activity).setStream(FileInputStream(imageFile))
runInMainThread {
dialog.dismiss()
toast(R.string.wallpaper_set)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.