Welcome to Android Central! Which phone? The proximity sensor is probably being triggered (because you're essentially making a phone call to check your messages). Make sure nothing is near the sensor, like your fingers or an ill-fitting case; also, a screen protector can also trigger the proximity sensor if there isn't a proper cutout where the sensor is (right near the front-facing camera).