Skip to content Skip to sidebar Skip to footer

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)

Solution 1:

Your Application's Context will not have a theme on it, despite the fact that you may set your app's default theme by using the theme attribute on the <application> element in your manifest. You need to use your Activity's Context when instantiating Views like that.

For example:

customFABcFab=newcustomFAB(MainActivity.this);

Post a Comment for "Error When Custom Class Extends Floatingactionbutton"