在Activity中添加
1:相对于在Window层中添加
Window window = getWindow();//获取Window层
DragFloatActionButton button = new DragFloatActionButton(getApplicationContext());//这是自己要添加的控件,想要加什么就替换成什么
button.setImageResource(R.drawable.ic_launcher_background);
button.setClickable(true);//这个button按钮是我的控件
window.addContentView(button,new ViewGroup.LayoutParams