Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在魅族手机android系统5.1上不显示 #2

Open
sheng930920 opened this issue Jan 15, 2016 · 6 comments
Open

在魅族手机android系统5.1上不显示 #2

sheng930920 opened this issue Jan 15, 2016 · 6 comments

Comments

@sheng930920
Copy link

在魅族手机android系统5.1上不显示

@fayou147
Copy link

fayou147 commented Sep 19, 2016

        if (Build.VERSION.SDK_INT < 21 || headsUp.getCustomView() != null || !headsUp.isActivateStatusBar()) {
            isPolling = true;
            show(headsUp);
        } else {
            //当 系统是 lollipop 以上,并且没有自定义布局以后,调用系统自己的 notification
            isPolling = false;
            notificationManager.notify(headsUp.getCode(), headsUp.getBuilder().setIcon(headsUp.getIcon()).build());

        }

自定义布局 || setActivateStatusBar(false)

@df13954
Copy link

df13954 commented Feb 6, 2017

博主,有没有办法,搞MIUI的系统。qq,微信是怎么搞的

@zzz40500
Copy link
Owner

zzz40500 commented Feb 6, 2017

直接使用5.0 以上的api.看readme

@df13954
Copy link

df13954 commented Feb 7, 2017

是直接使用5.0以上的API,还是无法弹出来,红米2a。5.1.1,MIUI8.

NotificationManager systemService = (NotificationManager)MainActivity.this.getSystemService(Context.NOTIFICATION_SERVICE);

        final Notification.Builder notif = new Notification.Builder(MainActivity.this)
                .setContentTitle("ssss")
                .setContentText("dddddddd")
                .setSmallIcon(R.drawable.abc_ab_share_pack_holo_dark) //ok
                .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher))
                .setPriority(Notification.PRIORITY_HIGH); //does not seem to make a difference
        if (Build.VERSION.SDK_INT >= 21) {
            notif.setVibrate(new long[0]);
            systemService.notify(222, notif.build());
        }

@lovelyelfpop
Copy link

设置 应用 里面要打开 悬浮通知 的开关

@lovelyelfpop
Copy link

qq 微信这种用户量大的社交聊天app,估计国产安卓ui都自动开启了 悬浮通知 的开关

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants