push notifications android studio

0

I have read something about floating notifications of incoming calls, but I can not find a way to do them. I just got the notifications and the simple ones work fine but I do not know how to do a floating.

On the other hand I create an icon with its different sizes etc but when putting the icon in the notification it goes wrong, you see the typical greenish blue circle and inside the tiny icon. I do not know if there is any way for the icon to occupy the entire circle or at least appear larger.

Another question. When launching a notification, if there is one already launched, it overwrites it, so even though it should have 2 or more, I can only have 1 at a time. How do I solve that?

Notification code:

        intent = new Intent(this,cocina.class);
        pending = PendingIntent.getActivity(this,0,intent,0);


        notificacion = new NotificationCompat.Builder(this);
        notificacion.setSmallIcon(R.drawable.camarero);
        notificacion.setContentTitle("Restaurante");
        notificacion.setContentText("Se ha actualizado el pedido de la mesa 1");
        notificacion.setContentIntent(pending);
        notificacion.setAutoCancel(true);
        notificacion.setLargeIcon(BitmapFactory.decodeResource(getResources(),R.drawable.camarero));

        NotificationManager notificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
        notificationManager.notify(notificacion_id,notificacion.build());
    
asked by miklotov 15.04.2017 в 16:08
source

0 answers