As a android developer when we where newbie to development we use to face a big issue
"Handle Screen Orientation Change"
What can this issue cause?
Well it cause hell lot of problem let me list it.
- It creates a new activity when ever we change the orientation.
- Consider playing audio file,This will reload the player twice and this will play two same song simultaneously.
- Causes memory management problem.
- Mess up continuity completely.Consider you have a 20 form field and you change the orientation filling 15 fields,This issue will cause the form to loose all those 15 field data.
So how to solve this issue. After analysis various code we came to know that google has given the solution to problem with a single line code in the Manifest.xml
Add this snippet to the activity attribute to solve this issue.
android:configChanges="orientation"
As that of like this in activity attribute
<activity android:label="@string/app_name" android:configChanges="orientation"
android:name=".com.android">
Now you are completely free from this orientation change problem.
No comments:
Post a Comment