Gif Image is a type of motion of Picture which is for short time. xml and set background to the root layout (View or ViewGroup) of the activity where you want to add animated gradient background. Programmatically add fragment Last post show how to inflate layout from XML. Click listeners are clean and fun to write. WindowManager.