I have created a few apps in an old version of Eclipse. When doing so, I would enter:
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"
within in the manifest file, and this has always changed the app theme with no problem. Recently, I began using the fancy new Java-ADT Eclipse program, and when I enter the above statement into the manifest file the app crashes. What I mean by this is when I plug a device in to test the app (whether it's my Galaxy II, Galaxy 4, or Galaxy Tab 3 10.1) the app installs properly (Eclipse gives no errors and claims everything is successful), but on the device the application loads an empty black screen and then crashes soon after with the message "Unfortunately, (app) has stopped". Am I missing something?
Here are some things to note:
The resulting application IS black with no title or notification bar (before crashing), and when I change the theme phrase to the same thing MINUS, say, "Fullscreen" it correctly displays a black screen with a notification bar but no title bar (before crashing). To me, this indicates that the phrase I'm entering is still correct by today's standards, and perhaps the change/modification that is needed lies elsewhere.
If I start a NEW project and run it, the "Hello World" app displays properly on all my devices, yet if I change the default theme (android:theme="@style/AppTheme") in the manifest file to ANY OTHER THEME, the app crashes ("Unfortunately, app has stopped").
I've tried overriding this by going a different route: I entered a series of phrases in the res-values-styles file (items that manually apply the "NoTitle" and "Fullscreen" attributes), but this only works for my Galaxy 4 and Tab 3 10.1 (my Galaxy II still displays the title). Plus the app is white, not black.
Any advice at this point will be a big help! Thanks
Thanks everyone. What ended up working for me was to place:
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
in the onCreate method.