简介 目录 评价 推荐
  • 我要占用你的昵称 2019-12-07
    如何实现消息弹框

    消息弹框用AlertDialog不就行了

    1回答·727浏览
  • 慕粉168168888 2019-05-17
    for循环,下载进度一直有声音啊,怎么解决?
    Notification.Builder builder = new Notification.Builder(this)
            .setAutoCancel(true)
            .setChannelId("test_channel_id")
            .setContentTitle("新消息来了")
            .setContentText("明天是周末,不用上班?你怕是在做梦!")
            .setOnlyAlertOnce(true)
            .setSmallIcon(R.mipmap.ic_launcher);
    
    manager.notify(1, builder.build());
    
    new Thread(new Runnable() {
        @Override
        public void run() {
            for (int i = 0; i < 100; i++) {
                try {
                    Thread.sleep(1000);
                    builder.setProgress(100, i, false);
    
                    manager.notify(1, builder.build());
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
    
            }
        }
    }).start();
    
    设置builder.setDefaults(Notification.FLAG_ONLY_ALERT_ONCE);这个是没有效果的


    1回答·955浏览
  • qq_北城痞子_0 2018-11-14
    我没有getManeger方法
    // 加上这个方法
    private NotificationManager getManager(){
        if (manager == null){
            manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
        }
        return manager;
    }


    2回答·1124浏览
  • weixin_慕莱坞5072321 2018-11-06
    通知栏的进度条的时候
    0回答·1027浏览
  • 慕数据9115892 2018-08-03
    实际写的时候报错
    2回答·1571浏览
数据加载中...
开始学习 免费