Hide time in Android notification without using custom layout

前端 未结 3 2249
隐瞒了意图╮
隐瞒了意图╮ 2020-12-09 02:25

In the bottom right corner of a standard Android notification is time (eg 12:00). Can I hide it without using custom notification layout?

3条回答
  •  忘掉有多难
    2020-12-09 02:59

    From API Level 17 onwards, you can use setShowWhen(false)

    public Notification.Builder setShowWhen (boolean show)

    Added in API level 17 Control whether the timestamp set with setWhen is shown in the content view.

    http://developer.android.com/reference/android/app/Notification.Builder.html#setShowWhen(boolean)

提交回复
热议问题