You do not need two lines in mainactivity.java, you need to select a theme using the ActionBar:
From res> layout> activity_main.xml (or whatever the layout name of your activity): on the Design tab, change the theme to "Holo.Light.DarkActionBar", for example.
AndroidManifest.xml ( ):
android:theme="@style/AppTheme"
"AppTheme" res > values > styles.xml :
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"></style>
, <application>:
<application
android:logo="@drawable/logo"
android:label="@string/app_name"
android:theme="@style/AppTheme"
...