The issue is resolved.
I dont know what is the role of this here, but it solved my issue and working perfectly.
android:configChanges="orientation|keyboardHidden|screenSize"
I have written the above line in the menifest
file inside activity
Now its working perfect.