开发者

Display Notifications on Tabs

开发者 https://www.devze.com 2023-03-01 04:05 出处:网络
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 ne

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

精彩评论

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