I am wondering how to check if my application is open and currently visible to the user when receiving an onMessage() from GCM. At first, I was just using my ow
onMessage()
Use SharedPreferences saving the boolean isVisible, and when you get the value from the preference you can add a default value.
SharedPreferences settings = context.getSharedPreferences("NAME_XXX", Activity.MODE_PRIVATE); settings.getBoolean("visible", false);