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

2

1

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).

Endomorphic answered 29/7, 2013 at 8:5 Comment(0)
W
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

Warmup answered 30/7, 2013 at 8:14 Comment(3)
Well, that is true but when I test the same app on another Samsung Galaxy s2 with Android OS 4.0.3 on it, it does not crash and also the animation works fine. Why only Galaxy s2 with Android 4.1.2?Endomorphic
I have tested my application in sony LT22i model without max version, it was working good, but when i tested in htc, it was not working good. it depends on library how they have customized. some customized Android like Sony,ect., they will consider max version from mobile if it is not mentioned in manifest. but for some device we've to mention otherwise it wont take from default settings(about in android device settings) and it will give inflating error to android results application wont work.Warmup
Well, that's not tues actually (about the max part - min part is mandatory though), check here why -> developer.android.com/guide/topics/manifest/… : ` Warning: Declaring this attribute is not recommended. First, there is no need to set the attribute as means of blocking deployment of your application onto new versions of the Android platform as they are released. By design, new versions of the platform are fully backward-compatible...` and so on ..Surfperch
B
0

You should use NOA library for ANdroid ANimation. This works great for Object ANimation....

Here is a link:

Boycott answered 29/7, 2013 at 8:8 Comment(3)
It is a nice library for animations. Really useful, but I am still not able to understand why it only works when I specify targetSdkVersion = "17" in my manifest.xml file. That too only for Android 4.1.2 and Samsung Galaxy S2 device. Can it be a device issue?Endomorphic
If it was sdk issue, shouldn't it also trouble when I run the app on other devices or other Android Versions?Endomorphic
I will try to update. However, I have my SDK version already updated to 22.0.1 and I am not facing any problem in animation or making my view visible in pre-honeycomb versions. I am facing the problem only with Samsung Galaxy s2 device that has Android version 4.1.2 (Jelly-Bean).Endomorphic

© 2022 - 2024 — McMap. All rights reserved.