【问题标题】:Notification icon in status bar without taking over status bar for several seconds?状态栏中的通知图标而不接管状态栏几秒钟?
【发布时间】:2012-06-22 01:08:04
【问题描述】:

我知道如何向状态栏发送通知,但是当它第一次启动时,它会占据整个状态栏,除了你的图标之外你什么都看不到。有什么方法可以在不占用整个状态栏几秒钟的情况下显示您的图标?

【问题讨论】:

    标签: android android-notifications android-notification-bar


    【解决方案1】:

    听起来您使用的是空的tickerText。只需将其设置为null,系统将不会尝试显示它。

    【讨论】:

    • 非常感谢。我使用的代码是: Notification notification = new Notification(R.drawable.icon, "" , System.currentTimeMillis());问题是我有空消息(“”),而我应该在那里有 null 。非常感谢它修复了它:)
    • 还有一件事,当我将 System.currentTimeMillis()) 取出或将 null 放在那里时,我怎样才能摆脱通知中的错误?
    • @jolee 时间是强制性的。这就是系统用于向用户显示时间戳的方式,也是对图标和通知进行排序的方式。将其设置为null 是没有意义的。
    • 是的,我还是去掉了状态栏中的时间,但输入了 0
    猜你喜欢
    • 2014-07-15
    • 2013-07-13
    • 2019-10-27
    • 2010-12-28
    • 1970-01-01
    • 1970-01-01
    • 2011-02-19
    • 1970-01-01
    相关资源
    最近更新 更多