java - Notifications not show up -


i working on messaging app, sends user notification when on different activtyon app or on app if user on messagingactivity.java updates chat history , not send notifications fine, problem arises when user on messagingactivity.java meanwhile email or else happen user leaves messagingactivity.java open , checks app if in meantime message comes user not receive notifications

public void parserequest(bundle extras) {     if (extras.containskey("for") && extras.containskey("recipientid")) {         if (integer.parseint(extras.getstring("recipientid")) == m.getid(this)) {             switch (extras.getstring("for")) {                 case "chat":                     if (isrunning("messagingactivity")) {                         intent intent = new intent("update_messages_list");                         intent.putextra("data", extras);                         sendbroadcast(intent);                     } else {                         intent resultintent = new intent(this, messagingactivity.class);                         resultintent.putextra("conversationid", integer.parseint(extras.getstring("conversationid")));                         resultintent.putextra("recipientid", integer.parseint(extras.getstring("ownerid")));                         m.shownotification(getapplicationcontext(), resultintent,                                 extras.getstring("ownerusername"),                                 extras.getstring("message"),                                 integer.parseint(extras.getstring("conversationid")));                     } 

let me know how checking messageactivity running i.e. functioning of isrunning("messagingactivity") method. if setting global boolean variable checking , making isrunning value false in ondestroy() method of activity then, according life cycle of activity not called until activity finished i.e. in case user switching messageactivity mail .


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -