title: How to use image for background color of linearlayout in android programmatically
body: <p><a href="https://i.stack.imgur.com/dOht8.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dOht8.jpg" alt="enter image description here" /></a>I have a hierarchy of views in which I wanted to set an image with gradient as a linear layout background color.</p>
  <p>in swift there were
  view.backgroundColor = UIColor(patternImage: yourImage)
  in android how can we do same.</p>
  <p>this is gradient image which I want to use
  this is my output for my one screen <a href="https://i.stack.imgur.com/DxR27.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DxR27.png" alt="enter image description here" /></a></p>