title: How to set custom font for a whole application in Android?
body: <p>Is it possible to set a custom font in an Android application?</p>
  
  <p>I tried what is posted <a href="https://stackoverflow.com/a/16883281/760893">here</a>, but I don't know where my <code>extends Application</code> class is...</p>
  
  <p>Any help?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>I tried the following:</p>
  
  <ul>
  <li>Add an assets folder and insert the font inside as seen here:</li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/fEVJu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fEVJu.png" alt="enter image description here"></a></p>
  
  <ul>
  <li><p>Add a new class that extends from <code>Application</code></p></li>
  <li><p>Call this new class from my <code>AndroidManifest.xml</code>.</p></li>
  <li><p>I went to my style and added it.</p></li>
  </ul>
  
  <p><strong>MyApp.java:</strong></p>
  
  <pre><code>public class MyApp extends Application {
    @Override
    public void onCreate() {
       super.onCreate();
      FontsOverride.setDefaultFont(this, "DEFAULT", "raleway_regular.ttf");
      //  This FontsOverride comes from the example I posted above
    }
    }
  </code></pre>
  
  <p><strong>AndroidManifest.xml:</strong></p>
  
  <pre><code>&lt;application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:name=".MyApp"
        android:theme="@style/AppTheme"&gt;
       ....
  </code></pre>
  
  <p><strong>styles.xml:</strong></p>
  
  <pre><code> &lt;style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"&gt;
      &lt;item name="android:fontFamily"&gt;default&lt;/item&gt;
   &lt;/style&gt;
  </code></pre>
  
  <p>But my font is still not changning... any idea?</p>
  
  <p>Then the <code>MyApp</code> class is called. But no effect on my fonts...</p>
  
  <p><strong>EDIT2:</strong> I realized that my buttons apply the custom font after I set a custom style for my buttons. Here is my custom button style:</p>
  
  <pre><code>&lt;style name="MyButtonStyle" parent="Widget.AppCompat.Button"&gt;
      &lt;item name="textAllCaps"&gt;false&lt;/item&gt;
      &lt;item name="android:textAllCaps"&gt;false&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And here is how it looks now:</p>
  
  <p><a href="https://i.stack.imgur.com/LLd70.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LLd70.png" alt="enter image description here"></a></p>
  
  <p>So: my button is applying the style, but not the <code>TextView</code>. Any idea on why my custom font is not being applied for all items in application?</p>