Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. if(giorni_di_differenza <= 15)
  2. {
  3.  
  4. try{
  5. PendingIntent pi = PendingIntent.getActivity(context, 0, new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
  6. NotificationCompat.Builder n = new NotificationCompat.Builder(context)
  7. .setContentTitle(nome_evento)
  8. .setContentText(descrizione_evento)
  9. .setContentIntent(pi)
  10. .setAutoCancel(true)
  11. .setLights(Color.GREEN, 1000, 1000)
  12. .setSmallIcon(R.drawable.ic_launcher);
  13.  
  14. NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  15.  
  16. notificationManager.notify(0, n.build());
  17.  
  18. }catch(Exception e){
  19. e.printStackTrace();
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement