问题
I have used Fragments and displaying a text animation in each fragment. Inside my Fragment activity I have taken a "next" button and have made it invisible. After the text animation is finished in a fragment, I am making the button visible and applying TranslateAnimation. When I test it on Samsung Galaxy s2 with Jelly Bean, the button is not getting visible on the first place. This happens when I remove the attribute,
android:targetSdkVersion="17"
from the manifest file. When I specify it back, the animation works fine and button gets visible too. However, it works find on any other device with Jelly Bean or even Samsung Galaxy s2 with ICS on it, even without specifying targetSdkVersion.
I wonder if anyone else is also facing the same problem and what could the problem be.
EDIT: In addition to the problem I mentioned, I also observed that when targetSdkVersion is not specified, the application crashes with outOfMemory error after changing several pages(Fragments) with Images in them. This is also particularly for Android OS version 4.1.2 (Jelly Bean).
回答1:
Every mobile is not coming with core Android. it is customized for specified mobiles. so it is always best practices to provide min and max version of android in manifest
回答2:
You should use NOA library for ANdroid ANimation. This works great for Object ANimation....
Here is a link:
来源:https://stackoverflow.com/questions/17918884/viewbutton-not-getting-visible-when-androidtargetsdkversion-17-not-specifie