如何在android中获取通知? [英] How to get notification in android?

查看:90
本文介绍了如何在android中获取通知?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了以下代码但不能正常工作..

 Intent intent = new Intent( this ,NoficationReceiver。 class ); 
PendingIntent pIntent = PendingIntent.getActivity( this 0 ,intent, 0 );
通知n = new Notification.Builder( this );
m_notificationManager.notify( 0 ,n);

解决方案

看看这个: Android服务初学者指南 [< a href =http://www.codeproject.com/Articles/822717/Beginner-s-Guide-to-Android-Services#android_notificationstarget =_ blanktitle =New Window> ^ ]


嘿,我试过这段代码,这对我有用。

查看此链接,希望这对您有所帮助。

http://linkflows.blogspot.in/2014/12/creating-notification-in- android.html [ ^ ]

I had tried out following code but Not working..

Intent intent=new Intent(this,NoficationReceiver.class);
		PendingIntent pIntent = PendingIntent.getActivity(this, 0, intent, 0);
		Notification n  = new Notification.Builder(this);
	  	m_notificationManager.notify(0, n);

解决方案

Check this out: Beginner’s Guide to Android Services[^]


Hey, I tried this code and this works for me.
Check this link, i hope this will help you.
http://linkflows.blogspot.in/2014/12/creating-notification-in-android.html[^]


这篇关于如何在android中获取通知?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆