title: Activity vs AppCompatActivity: Difference in UI
body: <p>I'm developing an Android app. In some cases I used an Activity and in others, an AppCompatActivity. Although I noticed one thing:</p>
  
  <p>Lets take this class for instance:</p>
  
  <pre><code>public class LoginActivity extends Activity {
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  
          if (android.os.Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.LOLLIPOP) {
              setTheme( android.R.style.Theme_Material_Dialog_NoActionBar_MinWidth);
          }
      }
  }
  </code></pre>
  
  <p>In this case the output is the desired one: <br/>
  <a href="https://i.stack.imgur.com/GlaWS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GlaWS.png" alt="enter image description here"></a></p>
  
  <p>When I change the extended class from <code>Activity</code> to <code>AppCompatActivity</code> the output changes to:<br/>
  <a href="https://i.stack.imgur.com/yddnB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/yddnB.png" alt="enter image description here"></a></p>
  
  <p>Why is this happening?</p>