0

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

Sagar Maiyad
  • 12,655
  • 9
  • 63
  • 99
Alan Harper
  • 793
  • 1
  • 10
  • 23

1 Answers1

1

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>
Oam
  • 912
  • 6
  • 7
  • One more question: when I use android:background in theme - it also changes part of background in active bar...which is a problem – Alan Harper Jun 12 '13 at 16:41