【发布时间】:2015-03-15 12:19:47
【问题描述】:
我不是开发人员,我正在努力让一些示例代码运行良好。 我运行的 API 与我正在使用的代码不是 100% 兼容。(API15)。
谁能帮我重新格式化这段代码以使用更新的样式builder notifications?
(我试过了,但根据链接的问题无法找到正确的方法)
{
Notification notification = new Notification(R.drawable.ic_launcher, "Robot service running", System.currentTimeMillis());
notification.setLatestEventInfo(this, "Robot Service", "Click to stop", PendingIntent.getService(this, 0, new Intent("stop", null, this, this.getClass()), 0));
notification.flags |= Notification.FLAG_ONGOING_EVENT;
nm.notify(0, notification);
}
【问题讨论】:
标签: java android notifications