I need a dialog activity. So i defined the activity in my Manifest file with:
android:theme="#android:style/Theme.Dialog"
but this theme has old Gingerbread look with dark background and so on. I want to complete holo theme on my dialog activity... Is there a theme like Theme.Dialog.Holo.Light ?
Use under activity tag:
<activity
android:theme="#android:style/Theme.Holo.Light.Dialog" >
</activity>
Related
I'm confused while reading some materials to set theme we use android:theme some like that, then where we can use its property?
Which property can be set in AndroidManifest.xml file for changing theme?
In your AndroidManifest.xml android:theme="#style/yourTheme" in each activity p.e.
<activity
android:name="com.example.helpingblind.Words"
android:label="#string/title_activity_words"
android:theme="#style/yourTheme1>
</activity>
<activity
android:name="com.example.helpingblind.Words"
android:label="#string/title_activity_words"
android:theme="#style/yourTheme2>
</activity>
This way you can implement a theme in each activity if you want
I have an activity with background colour black.
It has edittext and right after soft keyboard goes away, for a moment I see white area under keyboard; and then view gets resized.
This looks like blinking.
Question is, is it possible to set some kind of default background color for entire app? (Assuming that my activity already has background attribute)
windowSoftInputMode is also not an option
If you want to specify the background to your whole application, you may edit the app theme or add custom theme to your application manifest. But this will be overridden when background is specified in the xml layout.
Add custom theme in style.xml
<style name="MyTheme" parent="android:Theme">
<item name="android:background">#android:color/black</item>
</style>
Specify the theme in manifest as
<application
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/MyTheme" >
Adding theme for each activity in manifest
<activity
android:name=".Login"
android:configChanges="orientation"
android:theme="#style/MyTheme>
</activity>
You can also modify the existing theme in style.xml which is already defined in manifest by changing the background as desired
<item name="android:background">#android:color/black</item>
I am testing my app but when I choose settings my preferences screen shows White instead of the default black theme. Just with my app because any other app shows the right black theme in preference screen.
<style name="PreferencesTheme">
<item name="android:background">#000000</item>
</style>
add the above code in value -> styles and
then add
<activity android:name=".Preferrence" android:theme="#android:style/Theme.Black"></activity>
in your manifest file it will solve your problem :)
I guess you using the Light Theme in your AndroidManifest.xml. For those PreferenceActivity set the Theme like this:
<activity
android:name="PreferenceActivity"
android:theme="#android:style/Theme.Holo" >
</activity>
Initially in the manifest when i don't set any theme inside the activity tag my option menu look like this which is default..
But once i set this theme android:theme="#android:style/Theme.NoTitleBar" in the activity tag of my manifest file the option menu style changes.
Screen shots after adding android:theme="#android:style/Theme.Holo.NoActionBar.Fullscreen"
Why this happen.
Try this.
<activity
android:theme="#android:style/Theme.Holo.NoActionBar.Fullscreen" >
Look Here For Android Holo themes with backwards compatibility
Edit Try android:showAsAction="ifRoom" in menu.xml file. Look at this for More
I'm looking for to set the default titlebar in one layout into my app. But I'd set the Theme of the app to NoTitleBar.
How can I add by code to set/appear the titlebar?
Thx.
You can specify the theme for each activity in your AndroidManifest.xml file:
<activity android:name="Activity1" android:label="#string/app_name"
android:theme="#android:style/Theme.NoTitleBar.Fullscreen"/>
<activity android:name="Activity" android:label="#string/app_name"
android:theme="#android:style/SOMETHING_ELSE"/>
You can override a theme set on <application>, by defining theme on <activity>.