error when custom class extends FloatingActionButton
问题 I create a custom class and it extends FloatingActionButton public class customFAB extends FloatingActionButton { public customFAB(Context context) { super(context); } } I call this class from MainActivity customFAB cFab = new customFAB(getApplicationContext); But I get this error You need to use a Theme.AppCompat theme (or descendant) with the design library. my style.xml is <resources> <!-- Base application theme. --> <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <!--