My applications minSdkVersion is 15. So the buttons in the application will get a light blue color when the user touches it. Later i added a custom title for the application. After that my application components color is changed to orange when the user touches it. I found that it is the problem with the custom title. How to solve it. I need the features of sdk version 15. Please see how i added the custom title bar.
My Manifest.
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CustomTheme">
My style used for the custome title bar (custom_style.xml)
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomTheme" parent="android:Theme">
<item name="android:windowTitleSize">30dip</item>
</style>
</resources>
Activity code where it changes to the Custome title bar
requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
setContentView(R.layout.main);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.window_title);
My title bar layout(window_title.xml)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="30dip"
android:background="#FF0000" >
<ImageView
android:id="@+id/header"
android:src="@drawable/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="left"/>
<Switch
android:id="@+id/laodAutomatically"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="MirrorLink auto-connect"
style="@android:style/Theme.Holo"
android:layout_alignParentRight="true"
/>
</RelativeLayout>
Your theme should probably inherit from a theme, which is a theme for the SDK 15. There’s a nice tutorial that will get you started with supporting various SDK versions with themes and styles. Hope this helps.
http://developer.android.com/guide/topics/ui/themes.html
Your theme should selectively inherit either Theme, or android:Theme.Light, depending on the platform version. Look towards the end of this page.