android.support.design.widget.FloatingActionButton cannot be cast to com.melnykov.fab.FloatingAction

android.support.design.widget.FloatingActionButton cannot be cast to com.melnykov.fab.FloatingActionButton 

在浮动按钮能显示的状态下,在MainActivity里声明使用点击函数时出现闪退,并报错。

解决:

导错了类:

import com.melnykov.fab.FloatingActionButton;

正确的应为:

import android.support.design.widget.FloatingActionButton;

 

你可能感兴趣的:(安卓)