android.app.Notification.Notification(int icon, CharSequence tickerText, long when)翻译

定义Notification通知事件。

android.app.Notification.Notification(int icon, CharSequence tickerText, long when)

 

public Notification (int icon, CharSequence tickerText, long when)

Since: API Level 1

 

This constructor is deprecated.

Use Notification.Builder instead.

 

Constructs a Notification object with the information needed to have a status bar icon without the standard expanded view.

构建一个非标准的扩展视图,需要一个状态栏图标。

 

Parameters

icon  The resource id of the icon to put in the status bar.

tickerText  The text that flows by in the status bar when the notification first activates.

when  The time to show in the time field. In the System.currentTimeMillis timebase.

例如:

String tickerText = getString(R.string.imcoming_message_ticker_text, message);

Notification notif = new Notification(R.drawable.stat_sample, tickerText,

                System.currentTimeMillis());

再例如:

// Set the icon, scrolling text and timestamp.

// Note that in this example, we pass null for tickerText.  We update the icon enough that

// it is distracting to show the ticker text every time it changes.  We strongly suggest

// that you do this as well.  (Think of of the "New hardware found" or "Network connection

// changed" messages that always pop up)

//注意在这个例子中我们只是更新ICON图标,而不显示文字提示,我们强烈建议你这样做!!!因为考虑到类似有

//"找到新硬件"或“网络连接改变”这样的消息经常弹出来,怕影响他们。

Notification notification = new Notification(moodId, null, System.currentTimeMillis());

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值