Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(giorni_di_differenza <= 15)
- {
- try{
- PendingIntent pi = PendingIntent.getActivity(context, 0, new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS), 0);
- NotificationCompat.Builder n = new NotificationCompat.Builder(context)
- .setContentTitle(nome_evento)
- .setContentText(descrizione_evento)
- .setContentIntent(pi)
- .setAutoCancel(true)
- .setLights(Color.GREEN, 1000, 1000)
- .setSmallIcon(R.drawable.ic_launcher);
- NotificationManager notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- notificationManager.notify(0, n.build());
- }catch(Exception e){
- e.printStackTrace();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement