Android - Remove top banner in new application? - android

Is there a way to remove the banner that appears at the top of my new Android application that has the application name in it? I think I need to do something in the AndroidManifest.xml file, but I'm not sure what to do.

This is actually in the Common Tasks and How to Do Them under the section "Configuring General Window Properties."
[update] as per the comments
Either call...
requestWindowFeature(Window.FEATURE_NO_TITLE);
Or add the following to your Android manifest file...
<application android:icon="#drawable/icon"
android:theme="#android:style/Theme.NoTitleBar">

In file Style.xml:
(App--->src--->main--->res->values--->styles.xml) changes the < resources> to :
<resources>
<style name="AppTheme" parent="Theme.AppCompat.NoActionBar">
</style>
</resources>

Related

How to change app default theme to a different app theme?

I have an Android app that has a default theme of Holo.Light but I want to change it to Theme.Black.I tried to do this by changing the style tag in the manifest android:theme="#style/AppTheme" to Theme.Black but it cannot be found.Is there extra steps I have to take in changing the theme?
Actually you should define your styles in res/values/styles.xml. I guess now you've got the following configuration:
<style name="AppBaseTheme" parent="android:Theme.Holo.Light"/>
<style name="AppTheme" parent="AppBaseTheme"/>
so if you want to use Theme.Black then change AppBaseTheme parent to android:Theme.Black or you could change app style directly in manifest file like this - android:theme="#android:style/Theme.Black". You must be lacking android namespace before style tag.
You can read more about styles and themes here.
To change your application to a different built-in theme, just add this line under application tag in your app's manifest.xml file.
Example:
<application
android:theme="#android:style/Theme.Holo"/>
<application
android:theme="#android:style/Theme.Holo.Light"/>
<application
android:theme="#android:style/Theme.Black"/>
<application
android:theme="#android:style/Theme.DeviceDefault"/>
If you set style to DeviceDefault it will require min SDK version 14, but if you won't add a style, it will set to the device default anyway.
<uses-sdk
android:minSdkVersion="14"/>
If you are trying to reference an android style, you need to put "android:" in there
android:theme="#android:style/Theme.Black"
If that doesn't solve it, you may need to edit your question with the full manifest file, so we can see more details
Or try to check your mainActivity.xml you make sure that this one
xmlns:app="http://schemas.android.com/apk/res-auto"hereis included

Using theme generated by Holo Style Generator

I managed to get this done a few days back but now I've forgotten what steps I took to make it work.
I've generated a custom widget theme from http://android-holo-colors.com
I've copied it to my res folder. I need to know what to change in the manifest and the styles.xml file to make it work with my app. I've tried a lot of different things but the theme either doesn't change or generates and xml error.
manifest.xml
<activity
android:name="com.yourapp.app"
android:label="#string/app_name"
android:screenOrientation="landscape"
android:theme="#style/Theme.YourTheme"
...
</activity>
res/values/styles.xml
<style name="YourTheme" parent="android:Theme.Light">
...
</style>

How to keep 4.1 theme & remove TitleBar in Android?

When I created new Android application in Eclipse.In its AndroidManifest.xml the theme set to application isandroid:theme="#style/AppTheme"& style.xml is as follows.
<resources>
<style name="AppTheme" parent="android:Theme.Light" />
</resources>
& my screen appears like this.
I want to remove the TitleBar from app but want to show the theme of Android 4.1's.
For this I tried
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#android:style/Theme.Light.NoTitleBar" >
Now my screen appears like this the TitleBar is removed but theme has changed.
Please help me to sort out this issue.
Use this instead : #android:style/Theme.Holo.NoActionBar.
Try out putting this in your manifest.
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"

How to set the holo dark theme in a Android app?

How can I set the dark holo theme in my app?
At this time I got this:
<style name="AppTheme" parent="android:Theme.Holo.Light" />
But when I change it to:
<style name="AppTheme" parent="android:Theme.Holo.Dark" />
I get an error error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Dark'.
How to solve the problem?
change parent="android:Theme.Holo.Dark"
to parent="android:Theme.Holo"
The holo dark theme is called Holo
By default android will set Holo to the Dark theme. There is no theme called Holo.Dark, there's only Holo.Light, that's why you are getting the resource not found error.
So just set it to:
<style name="AppTheme" parent="android:Theme.Holo" />
According the android.com, you only need to set it in the AndroidManifest.xml file:
http://developer.android.com/guide/topics/ui/themes.html#ApplyATheme
Adding the theme attribute to your application element worked for me:
--AndroidManifest.xml--
...
<application ...
android:theme="#android:style/Theme.Holo"/>
...
</application>
In your application android manifest file, under the application tag you can try several of these themes.
Replace
<application
android:theme="#style/AppTheme" >
with different themes defined by the android system. They can be like:-
android:theme="#android:style/Theme.Black"
android:theme="#android:style/Theme.DeviceDefault"
android:theme="#android:style/Theme.DeviceDefault.Dialog"
android:theme="#android:style/Theme.Holo"
android:theme="#android:style/Theme.Translucent"
Each of these themes will have a different effect on your application like the DeviceDefault.Dialog will make your application look like a dialog box. You should try more of these. You can have a look from the android sdk or simply use auto complete in Eclipse IDE to explore the various available options.
A correct way to define your own theme would be to edit the styles.xml file present in the resources folder of your application.

Android Tablet Application - ActionBar

We are trying to build an Android App for Samsung Galaxy Tablets. Is there a way we can increase the height of the ActionBar? We are using Android 3.1 API 12.
You can apply a custom theme to your application.
Create styles.xml in your res/values/ directory and add something like this:
<style name="CustomTheme" parent="android:style/Theme">
<item name="android:actionBarSize">#dimen/action_bar_default_height</item>
</style>
Then create dimens.xml in your res/values/ directory and add something like this:
<resources>
<dimen name="action_bar_default_height">55dp</dimen>
</resources>
Then in your application manifest set the theme of the application like this:
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:logo="#drawable/ic_launcher"
android:theme="#style/CustomTheme" >
...
</application>
You will need to create a custom Action Bar.
Here is a good tutorial
Creating a custom Action bar
Also here is a good example from the dev site.
Android Action Bar

Categories

Resources