android - Handling Status Bar notification -
A background service is started in my app and I want to set the status bar notification from that service, that the start of the service Starting code:
context reference = getApplicationContext (); String NS = Reference. NETIFICATION_SERVICE; Int icon = R.drawable.icon; Charasata ticker text = "Hello"; Long time = System.currentTimeMillis (); Notification Notification = New Notification (icon, ticker text, when); CharacteristicTitle = "My Information"; Characters contentText = "Hello World!"; Intent notification copy = new intent (MyService.this, MyClass.class); Notification Newsletter (Int. FLAG_ACTIVITY_NEW_TASK); Pending Content ContentIntent = PendingEntert.Get Activity (This, 0, Notification Intent, 0); Notification.setLatestEventInfo (context, contentTitle, contentText, contentIntent); Notification Manager Manager Information Manager = (Notification Manager) getSystemService (ns); MNotificationManager.notify (1, Notification); The notification is displayed in the status bar, but I am clicking on the click that MyClass.class has not been removed. And in log in, it shows that "Input Manager Service Window is already focusing on focus ..."
Therefore, provide the solution.
Thank you in advance
I'm not sure that you "MyClass.class" What does it mean, but if it is already full and you hope that the creature is called again, then you can hope for the wrong result. I am doing a lot like this and the information is already running in the activity- Receiving the code to execute the derived class with a notification touch, I have pending INTent.FLAG_UPDATE_CURRENT perpendicular The pass as fourth parameter identifier am
PendingIntent ContentIntent = pending Aitiaktivtiviti (your service. This, 0, notification information, pending notification. FLAG_UPDATE_CURRENT); And I have executed my code in the following method of activity:
Public authorization (intent) on @NewIntent {super.onNewIntent ); // your code here}
Comments
Post a Comment