Skip to content

Instantly share code, notes, and snippets.

@illuzor
Created September 28, 2018 20:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save illuzor/de2ff9151c6258551c91de7788c69e20 to your computer and use it in GitHub Desktop.
Save illuzor/de2ff9151c6258551c91de7788c69e20 to your computer and use it in GitHub Desktop.
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