I'm not using configChanges attribute to my activity in manifest as I need to show a different layout for landscape mode. And saving few primitive data values in onSaveInstanceState() method and getting back in Bundle of onCreate(). Here are my issues :
- On click of a button I need to post data to server(using Volley for this). I'm showing a progress dialog during the server communication. App is force closing If I change the device orientation when progress dialog is shown. How can I handle progress dialog state during orientation change? If I use configChanges in manifest, its not force closing but a different layout is not being shown. Please guide me.
- I need to show different layout for android tablets only. The screen should not get rotated in other phones. Is there a way to specify configChanges for only other phones? How do I do this?
You should probably add this in your manifest file first (note the
configChanges
):Then override these two methods and do what you want with the data inside
onSaveInstanceState()
,onRestoreInstanceState()
.