performance - Android: Navigation Drawer slows down on adding Ongoing Notification -


i had created foreground service. adding ongoing notification in notification drawer. if open navigation drawer on starting service, ui starts lagging.

 intent contentintent = new intent(this, mainactivity.class);     contentintent.setflags(intent.flag_activity_new_task | intent.flag_activity_clear_task);     pendingintent pendingintent = pendingintent.getactivity(this,0,contentintent,0);      intent stopintent = new intent(this,manager.class);     stopintent.setaction(types.action_stop_service);     pendingintent stopserviceintent = pendingintent.getservice(this,0,stopintent,0);      notification notification = new notificationcompat.builder(this)             .setsmallicon(r.drawable.logo)             .setlights(0x008080, 100, 500)             .setticker(types.noti_title)             .setcontenttitle(types.noti_title)             .setcontenttext(types.noti_connect_text)             .setcontentintent(pendingintent)             .addaction(0, "tap here stop", stopserviceintent)             .setpriority(notification.priority_max)             .setongoing(true).build();     startforeground(types.service_notification_id,notification); 

any ideas, why navigation drawer became slow ?

i found solution, resources used in notification large. making smaller solved this.


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -