How can I display a warning information "missed call" in notification bar when I hang up a call programmatically in android? -


Now I can call a call program in android using the document

Generally , A warning notice "missed call ..." and when a call misses a system icon will be displayed in the notification bar.

But alert information "missed call ..." and a system icon will not be displayed when I kill killCall (reference reference) killCall (reference reference) ?

And more, I hope that after using the records of Miss Call, how can I do this to display alert information and programmatically display system icons? When I click on the system icon can be displayed

Enter the image details here

Add this code only after the call is canceled:

  Notification Manager nManager = (NotificationManager) getSystemService (context.NOTIFICATION_SERVICE); Intention = Intentional Intent (this, TheClassYouWantToOpenOnNotificationClick.class); Pending print-pIntent = pending content. Gate activity (this, 0, intent, pending provider. FLAG_UPDATE_CURRENT); Notification Notification = New Notification. Builder (idleService) This .setContentTitle ("Missed Call!") .setContentText ("Missed Call From Phone Number) .setSmallIcon (R.drawable.your_icon) .setContentIntent (pIntent) .setAutoCancel (True) .build (); NManager.notify (0, Notification);   

Where phone number number can be a string with the number of missed calls.

Hope this helps :)

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -