soxfmr
soxfmr

Reputation: 58

Android LayoutTransition

I want to use the LayoutTransition class that it can achieve animation.But Eclipse tell me Call requires API level 11 (current min is 7). And I just want to call this API in Android2.1+. So, Here What way can be deal with it(such as the Open Sources library)?

Thank you very much for your answer.

Upvotes: 0

Views: 395

Answers (1)

asenovm
asenovm

Reputation: 6517

This error comes from Android Lint. You can suppress it by adding an @SuppressLint("NewApi"). Then in the body of the method using LayoutTransition you can add the following code:

if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
   //use LayoutTransition in your code
} else {
   //on Android 7-11, don't use LayoutTransition
}

Upvotes: 1

Related Questions