Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bundle bundle = msg.getData();
- byte[] data = bundle.getByteArray("data");
- String dataString = new String(data);
- if (dataString.equals("---N"))
- statusMessage.setText("Erro de conexão.");
- else if (dataString.equals("---S"))
- statusMessage.setText("Conectado.");
- //GerarNotificacao();
- }
- };
- NotificationManager nm = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
- PendingIntent p = PendingIntent.getActivity(this, 0, new Intent(this, ActTelaUsuarios1.class), 0);
- NotificationCompat.Builder builder = new NotificationCompat.Builder(this);
- builder.setTicker("Ticker Texto")
- .setContentTitle("Titulo")
- .setContentText("Texto")
- .setSmallIcon(R.mipmap.logo_riscos)
- .setLargeIcon(BitmapFactory.decodeResource(getResources(), R.mipmap.logo_sem_fundo));
- builder.setContentIntent(p);
- Notification n = builder.build();
- nm.notify(R.mipmap.ic_launcher, n);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement