I have a very simple test project that in the onCreate event of screen 1 sends a notification, which upon clicking opens screen 2.
Proposedly, I quickly click on the notification to open the new screen (testing purposes) by doing some sort of "Stress" to simulate some kind of error.
The problem is that time opens normally and sometimes a white screen remains.
Why does this occur?
I tested on 3 devices:
- Samsung CORE 2 - DOES NOT WORK EVERY TIME.
- Samsung Galaxy S3 mini - WORKED EVERY TIME.
- Samsung Galaxy S duos - DEU PROBLEM A LITTLE TIME
Does this have to do with RAM, processor? Or is my code running in the wrong order?
public void sendNotification() {
int NOTIFICATION_ID = 1;
NotificationManagerCompat nm = NotificationManagerCompat.from(this);
Intent it = new Intent(this, NovaTela.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(this);
stackBuilder.addParentStack(NovaTela.class);
stackBuilder.addNextIntent(it);
PendingIntent pit = stackBuilder.getPendingIntent(
0, PendingIntent.FLAG_CANCEL_CURRENT);
NotificationCompat.Builder mBuilder =
new NotificationCompat.Builder(this)
.setDefaults(Notification.DEFAULT_ALL)
.setAutoCancel(true)
.setContentIntent(pit)
.setSmallIcon(R.mipmap.ic_launcher)
.setContentTitle("Teste Notificação")
.setContentText("teste");
nm.notify(NOTIFICATION_ID, mBuilder.build());
}