0

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.

Avijit
  • 3,834
  • 4
  • 33
  • 45
soxfmr
  • 58
  • 7

1 Answers1

1

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
}
asenovm
  • 6,397
  • 2
  • 41
  • 52