I\'ve got the following code to create a status bar notification:
public void txtNotification(int id, String msg){
NotificationManager manager = (Notificatio
For dummies like myself: Getting this yourpackage.notifyId at MainActivity:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Bundle intent_extras = getIntent().getExtras();
if (intent_extras != null && intent_extras.containsKey("yourpackage.notifyId"))
{
//Do the codes
}
}
In my case - used it to determine who is opening my mainactivity, user or a call from notification, cteated by GcmIntentService... P.S. I've used names without "youpackage", works fine too.