android-Notification.Style

Notification.Style

public static abstract class Notification.Style 
extends Object 

java.lang.Object
   ↳ android.app.Notification.Style
Known Indirect Subclasses


An object that can apply a rich notification style to a Notification.Builder object.

Summary


Fields

protectedNotification.Builder mBuilder

Public constructors

Notification.Style()

Public methods

Notification build()

Calls build() on the Builder this Style is attached to.

void setBuilder(Notification.Builder builder)

Protected methods

void checkBuilder()
RemoteViews getStandardView(int layoutId)
void internalSetBigContentTitle(CharSequence title)

Overrides ContentTitle in the big form of the template.

void internalSetSummaryText(CharSequence cs)

Set the first line of text after the detail section in the big form of the template.

Inherited methods

From class java.lang.Object

Fields


mBuilder

Added in  API level 16
Notification.Builder mBuilder

Public constructors


Notification.Style

Added in  API level 16
Notification.Style ()

Public methods


build

Added in  API level 16
Notification build ()

Calls build() on the Builder this Style is attached to.

Returns
Notification the fully constructed Notification.

setBuilder

Added in  API level 16
void setBuilder (Notification.Builder builder)

Parameters
builder Notification.Builder

Protected methods


checkBuilder

Added in  API level 16
void checkBuilder ()

getStandardView

Added in  API level 16
RemoteViews getStandardView (int layoutId)

Parameters
layoutId int
Returns
RemoteViews  

internalSetBigContentTitle

Added in  API level 16
void internalSetBigContentTitle (CharSequence title)

Overrides ContentTitle in the big form of the template. This defaults to the value passed to setContentTitle().

Parameters
title CharSequence

internalSetSummaryText

Added in  API level 16
void internalSetSummaryText (CharSequence cs)

Set the first line of text after the detail section in the big form of the template.

Parameters
cs CharSequence
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android中,可以通过监听状态栏通知来获取通知的相关信息。在实现这个功能时,需要创建一个继承自NotificationListenerService的类,并重写onNotificationPosted和onNotificationRemoved方法。其中,onNotificationPosted方法用于在通知被发布时触发,而onNotificationRemoved方法用于在通知被移除时触发。 在具体的实现中,可以通过StatusBarNotification对象来获取通知的详细信息,例如通过sbn.getNotification()可以获取通知的内容。 为了使应用具备监听状态栏通知的功能,还需要在AndroidManifest.xml文件中进行相应的配置。需要在<manifest>标签内添加一个<service>标签,并设置android:name为你创建的NotificationListenerService的类名。同时,需要添加一个<intent-filter>标签,并设置action为"android.service.notification.NotificationListenerService"。最后,还需要添加android:permission="android.permission.BIND_NOTIFICATION_LISTENER_SERVICE"以获取相应的权限。 通过以上的步骤,你就可以在Android上监听状态栏通知并获取相应的信息了。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [android监听Notification](https://blog.csdn.net/zhaicaixiansheng/article/details/47279251)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] - *2* *3* [Android 4.4 KitKat NotificationManagerService使用详解与原理分析(一)__使用详解](https://blog.csdn.net/yihongyuelan/article/details/40977323)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值