开发者

Display Notifications on Tabs

I am working 开发者_JAVA技巧in an android project, I need to display the notification on the tab when a new message arrives. How can we add this notification please help me............. Thanks.


you need to use Broadcast Receiver for checking incoming message and on Receive of the Broadcast check for ndroid.provider.Telephony.SMS_RECEIVED

if (intent.getAction().equals("android.provider.Telephony.SMS_RECEIVED")) {} like this

and use NotificationManager to show notification

mNotificationManager = (NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE);
                    Notification notifyDetails = new Notification(R.drawable.icon,"message received",System.currentTimeMillis());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜