Take the 2-minute tour ×

I have my own implementation of Dialog

public class MyDialog extends Dialog

Is it possible to respond to orientation change from within the MyDialog class and change layout used by the dialog if Activity that creates it has the following in the manifest:



share|improve this question
add comment

2 Answers

The android:configChanges="orientation" flag just indicates that the Activity class will perform the orientation adjustments on it's own and that the Activity should not be destroyed/recreated (onCreate will not be called again) when orientation changes. You can find a good explanation on how to handle this @ Android. How to make application completely ignore screen orientation change?

Also in my point of view we should try and avoid setting this flag as it's not considered as a best practice. A more appropriate way to handle Activity recreates upon orientation changes is explained in detail @ http://blog.doityourselfandroid.com/2010/11/14/handling-progress-dialogs-and-screen-orientation-changes/ in detail.

share|improve this answer
add comment

The way you have declared it in your manifest, you say you will handle orientation changes yourself. Your activity won't get restartet, but onConfigurationChanged() will be called. You should do the necessary adjustments there.

You probably have to dismiss the dialog and re-show it within onConfigurationChanged().

share|improve this answer
that means that the change is to be made in [every] activity that invokes the dialog. I very much would like to avoid that. –  Asahi Mar 8 '11 at 15:29
add comment

Your Answer


