0

I'm trying to use the library but there's this line in Manager.java (line 215)

croutonView.getViewTreeObserver().removeOnGlobalLayoutListener(this);

that I don't understand how to fix. Eclipse says

Call requires API level 16 (current min is 4): android.view.ViewTreeObserver#removeOnGlobalLayoutListener

I don't think I can just simply change the current min API level to fix it.

user1923613
  • 626
  • 5
  • 11
  • 31

2 Answers2

1

Use this

 <uses-sdk
      android:minSdkVersion="16" />

instead of 

 <uses-sdk 
      android:minSdkVersion="4" />

in AndroidManifest.xml

selva_pollachi
  • 4,147
  • 4
  • 29
  • 42
0

You'll need to compile against android:targetSdkVersion="16" or greater.

The ViewTreeObserver call will only be made for Jelly Bean and up in Version 1.8.1.

Ben Weiss
  • 17,182
  • 6
  • 67
  • 87
  • 1
    I don't know how but I think I fixed it by adding the support library. minSDKVersion is still set to 4 in the Crouton manifest. – user1923613 Jun 10 '13 at 14:44