Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. Bundle bundle = msg.getData();
  2. byte[] data = bundle.getByteArray("data");
  3. String dataString = new String(data);
  4.  
  5. if (dataString.equals("---N"))
  6. statusMessage.setText("Erro de conexão.");
  7. else if (dataString.equals("---S"))
  8. statusMessage.setText("Conectado.");
  9.  
  10. //GerarNotificacao();
  11.  
  12. }
  13. };
  14.  
  15. NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
  16. PendingIntent p = PendingIntent.getActivity(this, 0, new Intent(this, ActTelaUsuarios1.class), 0);
  17.  
  18. NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
  19.  
  20. builder.setTicker("Ticker Texto")
  21. .setContentTitle("Titulo")
  22. .setContentText("Texto")
  23. .setSmallIcon(R.mipmap.logo_riscos)
  24. .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.logo_sem_fundo));
  25.  
  26. builder.setContentIntent(p);
  27.  
  28. Notification n = builder.build();
  29. nm.notify(R.mipmap.ic_launcher, n);
  30.  
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement