Android Studio Activity theme causes crash



I have spent a long time on forums looking at how to change the theme for my activities in android app development.


My main objective is to remove the title bar. But would still like to know how to change themes in general.


I have tried changing the theme using the GUI built into Android Studio... the theme changes in the preview, but when I run the app on my phone nothing changes.


So I figured I would change the theme using some xml code in the Manifest file.


What everyone seems to be doing is the following:



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://ift.tt/nIICcg"
package="com.example.dennis.activeapp" >

<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"

<!-- HERE IS WHERE I SET THE THEME -->

android:theme="@android:style/Theme.NoTitleBar.Fullscreen">

<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".SecActivity"
android:label="@string/title_activity_sec" >
</activity>
<activity
android:name=".FirActivity"
android:label="@string/title_activity_fir" >
</activity>
</application>

</manifest>


The above is my code.


Now, when I try to run this on my phone the app crashes. The app opens for a fraction of a second and then closes.


If it is any help my phone is the Cubot S208. Since I have a feeling the problem might not be the code, as I followed directly what people have said in previous posts/forums.


No comments:

Post a Comment