我在我的项目中使用这个库:https://github.com/recruit-lifestyle/FloatingView的Android权限被拒绝窗式2007
,我得到这个错误: Click here for picture of error
这个库不工作的棉花糖和牛轧糖。
代码:
final LayoutInflater inflater = LayoutInflater.from(bCon);
final ImageView iconView = (ImageView) inflater.inflate(R.layout.widget_chathead, null, false);
final DisplayMetrics metrics = new DisplayMetrics();
final WindowManager windowManager = (WindowManager)bCon.getSystemService(Context.WINDOW_SERVICE);
windowManager.getDefaultDisplay().getMetrics(metrics);
mFloatingViewManager = new FloatingViewManager(bCon, this);
mFloatingViewManager.setFixedTrashIconImage(R.drawable.ic_trash_fixed);
mFloatingViewManager.setActionTrashIconImage(R.drawable.ic_trash_action);
final FloatingViewManager.Options options = new FloatingViewManager.Options();
options.overMargin = (int) (16 * metrics.density);
mFloatingViewManager.addViewToWindow(iconView, options);
@EJoshuaS无法添加窗口android.view.ViewRootlm[email protected] - 针对窗口类型2007的权限denides –