最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android  Notification使用方法詳解

 更新時間:2017年05月25日 14:52:00   作者:宋錚  
這篇文章主要介紹了Android Notification使用詳解的相關資料,需要的朋友可以參考下

Android  Notification使用詳解

Notification

核心代碼(鏈式調用):適用于Android 4.0以上(不兼容低版本)

Notification noti = new Notification.Builder(this)
.setContentTitle("標題名稱")
.setContentText("標題里的內容")
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(BitmapFactory.decordResource(getResources(), R.drawable.ic_launcher))
.build();

NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
nm.notify(0, noti);

兼容版本

Notification notification = new Notification(R.drawable.ic_launcher, "xxxxxx", System.currentTimeMillis());
//點擊事件真正想執(zhí)行的動作
Intent intent = new Intent();
intent.setAction(Intent.ACTION_DIAL);
intent.setData(Uri.parse("tel:110"));
PendingIntent contentIntent = PendingIntent.getActivity(this, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
notification.setLatestEventInfo(this, "標題", "內容", contentIntent);
NotificationManager nm = (NotificationManager) getSystemManager(NOTIFICATION_SERVICE);
nm.notify(0, notification);

感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!

相關文章

最新評論

兴文县| 平远县| 龙陵县| 团风县| 三江| 塔河县| 龙岩市| 栖霞市| 饶河县| 湟源县| 郴州市| 鹤峰县| 兴化市| 昌乐县| 亚东县| 安西县| 汉中市| 瑞丽市| 金华市| 隆尧县| 丰都县| 方山县| 靖西县| 湘阴县| 定南县| 炎陵县| 精河县| 惠东县| 广昌县| 肥西县| 凤台县| 昆山市| 鱼台县| 红原县| 博野县| 方正县| 新密市| 金塔县| 津市市| 唐山市| 武邑县|