TabActivity > Theme > Activity : unable to override ?

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

TabActivity > Theme > Activity : unable to override ?

Postby laguiz » Mon Dec 15, 2008 10:22 pm

Hi all,

I'm disappointed about Theme for Activities. I explain to you :

I have 2 activities :
1. MyTabActivity (TabActivity)
2. MyActivity (Activity)

MyActivity is include in a tab in MyTabActivity

I have 2 styles (one by activity that define drawable's background) :
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <style name="TabStyle" parent="@android:style/Theme.Black">
  2.  
  3.         <item name="android:background">@drawable/tab_bg</item>
  4.  
  5. </style>
  6.  
  7. <style name="DefaultStyle" parent="@android:style/Theme.Black">
  8.  
  9.         <item name="android:background">@drawable/default_bg</item>
  10.  
  11. </style>
Parsed in 0.001 seconds, using GeSHi 1.0.8.4


My AndroidManifest.xml :
Syntax: [ Download ] [ Hide ]
Using xml Syntax Highlighting
  1. <activity android:name=".tabs.MyTabActivity" android:label="@string/
  2. app_name" android:theme="@style/TabStyle">
  3.  
  4.         <intent-filter>
  5.  
  6.                 <action android:name="android.intent.action.MAIN" />
  7.  
  8.                 <category android:name="android.intent.category.LAUNCHER" />
  9.  
  10.         </intent-filter>
  11.  
  12. </activity>
  13.  
  14. <activity android:name=".MyActivity" android:theme="@style/
  15. DefaultStyle">
  16.  
  17. </activity>
Parsed in 0.002 seconds, using GeSHi 1.0.8.4


Info : My layout doesn't contain any background definition, there are
pretty simple.

Problem : Theme for MyActivity is TabStyle instead of DefaultStyle.
In other words I see "@drawable/tab_bg" for background in MyActivity
instead of "@drawable/default_bg". I don't understand why the
background is not override. Am I going in the go way? or is it not logic ?

I would like to do that to do something like
http://devtcg.blogspot.com/2008/03/adva ... -demo.html
If you have an idea to do let me know.

Maxence

NB : Problem appear with other definition, like android:textColor ...
laguiz
Once Poster
Once Poster
 
Posts: 1
Joined: Mon Dec 15, 2008 10:12 pm

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 3 guests