Collect all kinds of android-wallpaper programming exceptions and fault solutions.

How to set wallpaper using Android studio

I want to make a program that include a button and when it is pressed it changes the home screen or lock screen wallpaper with a picture I put it in the the app while developing it.