These is my layout:
I need to save the scrolling position when the orientation changes. for example if the screen shows layout starting from middle name in portrait mode,it should start from same in the landscape mode.
You If your activity is not changing anything on rotation you can use android:configChanges="orientation|keyboardHidden|screenSize" in manifest file within this particular activity. But this is clearly workaround and not a proper solution.
Note:
If you need to use different views for landscape and portraits or if you need to use different views for different devices, One should use bundle and save data onsaveinstancestate and retrieve the data in oncreate. This method stops to recreate the activity and activity assumes that things will be handled by the user himself/herself.