View(Button) not getting visible when android:targetSdkVersion=“17” not specified in manifest.xml for Android 4.1.2 (Samsung Galaxy s2 gt-i9100)

≡放荡痞女 提交于 2019-12-02 11:43:24

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!