1

I have seen this behavior in many chat application. What i notice is that, whenever you are using the app means when the app is in foreground, then if somebody send you the message, it appears on the chat list.

But if you are not using your application means the app is in background and u r not log out yet, then if somebody send you the message, it appears on the notification with some sound. So i want to know how can we detect that the app we are using is in background or in foreground, so based on this i can perform action.

Rahul
  • 1,667
  • 6
  • 21
  • 38
  • 1
    I suggest you to go through this link: http://stackoverflow.com/questions/3667022/android-is-application-running-in-background – Rushabh Patel Jul 16 '13 at 06:08
  • im not sure about this..just my thoughts only service work on background so you will know that it will work on background if it is a service app just my thought – Giant Jul 16 '13 at 06:08
  • @RushabhPatel yeh it helps a lot...and able to solve the issue – Rahul Jul 16 '13 at 08:06

0 Answers0