We help IT Professionals succeed at work.

android - error:<style> cannot appear in tag <style> only <item>

is there a problem with this?:

<style name="Animations" parent="@android:Animation" >
    <style name="Animations.SplashScreen">
        <item name="android:windowEnterAnimation">@anim/appear</item>
        <item name="android:windowExitAnimation">@anim/disappear</item>
    </style>
</style>
       
Comment
Watch Question

Commented:
Logically what you have written is correct. But, to my understanding, for your purpose, I think you will have to some thing like,

<?xml version="1.0" encoding="utf-8"?>
<selector   xmlns:android="http://schemas.android.com/apk/res/android">  
<item android:state_focused="true"
         android:state_pressed="false"
         android:drawable="@drawable/icon_1" />
<item android:state_focused="true"
         android:state_pressed="true"
         android:drawable="@drawable/icon_1_press" />
<item android:state_focused="false"
         android:state_pressed="true"
         android:drawable="@drawable/icon_1_press" />
<item android:drawable="@drawable/icon_1" />
</selector>

You will have to modify it as per your requirement.
GlobaLevelProgrammer

Author

Commented:
im still getting errors with this thing:

It doesnt like the selector when I add it...doesnt like the item...

I would think that this normal coding standard for android...
android:windowEnterAnimation
<resources>
 <!--    <style name="Theme.Transparent" parent="android:Theme">
        <item name="android:windowIsTranslucent">true</item>
        <item name="android:windowBackground">@android:color/transparent</item>
        <item name="android:windowContentOverlay">@null</item>
        <item name="android:windowNoTitle">true</item>
        <item name="android:windowIsFloating">true</item>
        <item name="android:backgroundDimEnabled">false</item>
    </style>    
    
<style name="Animations" parent="@android:Animation" >
    <style name="Animations.SplashScreen">
        <item name="android:windowEnterAnimation">@anim/appear</item>
        <item name="android:windowExitAnimation">@anim/disappear</item> 
    </style>
</style>

        --> 
    
    

<item android:state_focused="true"
         android:state_pressed="false"
         android:drawable="@anim/appear" />
<item android:state_focused="true"
         android:state_pressed="true"
         android:drawable="@anim/disappear" />
<item android:state_focused="false" 
         android:state_pressed="true"
         android:drawable="@anim/appear" /> 
<item android:drawable="@anim/appear" />


    
        
</resources>

Open in new window

GlobaLevelProgrammer

Author

Commented:
the problem, im having is that I need to click on a button on my screen in android and have it got to another .xml...why is that so difficult?
GlobaLevelProgrammer

Author

Commented:
the user should click on a button  on a.xml and b.xml should open for the user to see...