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

Android  Notification使用方法詳解

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

Android  Notification使用詳解

Notification

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

Notification noti = new Notification.Builder(this)
.setContentTitle("標題名稱")
.setContentText("標題里的內(nèi)容")
.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, "標題", "內(nèi)容", contentIntent);
NotificationManager nm = (NotificationManager) getSystemManager(NOTIFICATION_SERVICE);
nm.notify(0, notification);

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

相關(guān)文章

最新評論

拉萨市| 南充市| 昌图县| 临清市| 忻城县| 桑植县| 鹿邑县| 长武县| 关岭| 博客| 沐川县| 兴安县| 如东县| 五大连池市| 凯里市| 龙游县| 岱山县| 葵青区| 广南县| 佛山市| 英德市| 吉林市| 蒲江县| 邵阳县| SHOW| 潜江市| 准格尔旗| 邢台县| 九江市| 清河县| 顺昌县| 河池市| 乌什县| 扎鲁特旗| 十堰市| 辉南县| 郧西县| 麟游县| 红桥区| 句容市| 沾化县|