Skip to content Skip to sidebar Skip to footer

How To Make Fab Work In Fragment From A Activity And Not In Appcompatactivity

I'm putting my FAB in a Fragment from an Activity and I keep getting this error: 10-01 21:01:55.238 22031-22031/com.vei.scanandgo E/AndroidRuntime: FATAL EXCEPTION: main Process:

Solution 1:

Do we have a way to make this FAB work with Activity?

Not directly. android.support.design.widget.FloatingActionButton requires AppCompatActivity and Theme.AppCompat.

I have a cross-port of that widget in this library that works with a regular Activity (or FragmentActivity), but it is for a minSdkVersion of 21 or higher, as it requires Theme.Material.

There are other FAB implementations, such as this one, that do not require appcompat-v7 and do not require Theme.Material.

Post a Comment for "How To Make Fab Work In Fragment From A Activity And Not In Appcompatactivity"