I have BroadcastReceiver when new Message is received will start MessageActivity, but how not to start this Activity if my MainActivity is in front of screen?
By the way, I am trying to not use Singleton Activity.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You will need to keep track of your Activity with OnResume and onPause methods.
So something like this should help you to check if MainActivity is on foreground.