Given the following theme in your themes.xml file:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
And the following activity in your AndroidManifest.xml file:
<activity android:name=".MyActivity">
</activity>
Add the line of code that should apply the theme AppTheme to this activity.