我在我的項目中使用這個庫: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 –