I am trying to use Paho Android MQTT library (downloaded from here). The sample service application works fine, the subscribe and the publish meth
If by 'close' you mean 'force stop' the app, then yes that completely stops the app and you won't receive messages (but that's probably what the user wanted anyways).
If however, by 'close' you mean the user/android killing the app, then you are not receiving notifications because you are not 'connected' the broker anymore.
A solution would be to create a custom Service
to manage connections.
Checkout my answer here for a detailed solution of what worked for me.