title: What is the difference between gravity and layout_gravity in Android?
body: <p>I know we can set the following values to the <strong><code>android:gravity</code></strong> and  <strong><code>android:layout_gravity</code></strong> properties:</p>
  
  <ol>
  <li><code>center</code></li>
  <li><code>center_vertical</code></li>
  <li><code>center_horizontal</code>, etc.</li>
  </ol>
  
  <p>But I am confused regarding both of these.</p>
  
  <p>What is the difference between the usage of <code>android:gravity</code> and <code>android:layout_gravity</code>?</p>