当我打开游戏时,Android聊天头被杀死

时间:2016-07-12 00:20:57

标签: android

我正在使用https://github.com/recruit-lifestyle/FloatingView
在android上创建像messenger一样的chathead 但是当我打开一个游戏时,聊天室就会被杀死 有没有办法在游戏上方显示聊天头? 请帮助,谢谢

lib中的WindowManager配置:

mWindowManager = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
    mParams = new WindowManager.LayoutParams();
    mMetrics = new DisplayMetrics();
    mWindowManager.getDefaultDisplay().getMetrics(mMetrics);
    mParams.width = ViewGroup.LayoutParams.WRAP_CONTENT;
    mParams.height = ViewGroup.LayoutParams.WRAP_CONTENT;
    mParams.type = WindowManager.LayoutParams.TYPE_PRIORITY_PHONE;
    mParams.flags = WindowManager.LayoutParams.FLAG_NOT_FOCUSABLE |
            WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS |
            WindowManager.LayoutParams.FLAG_NOT_TOUCH_MODAL;
    mParams.format = PixelFormat.TRANSLUCENT;
    mParams.gravity = Gravity.LEFT | Gravity.BOTTOM;

0 个答案:

没有答案