0

I'm new to Android studio and I am wondering where to set the default font family for Android app in Android studio after reading the accepted answer here.

I have tried to put the code in activity_main.xml and AndroidManifest.xml but it does not work.

Any help would be appreciated!

Community
  • 1
  • 1
  • 2
    you will find style.xml in value folder add font style in your theme and than pass tis style in manifest application theme – KDeogharkar Jan 23 '16 at 06:20

2 Answers2

2

Thanks KDeogharkar!

Looks like I would have to add the code inside of styles.xml in values folder. It worked :)

1

/res/values*/themes.xml

Pick any parent theme to extend here

<?xml version="1.0" encoding="utf-8"?>
<resources>

<style name="AppTheme" parent="AppBaseTheme">
    <item name="android:textViewStyle">@style/RobotoFont</item>
</style>
<style name="RobotoFont" parent="android:Widget.TextView">
    <item name="android:fontFamily">sans-serif</item>
</style>
</resources>

Then in your app manifest

android:theme="@style/AppTheme`"
childofthehorn
  • 697
  • 1
  • 4
  • 12