Dialog getting destroyed on orientation change
<p>I have two classes one adapter and one activity, i have a dailog in my adapter , amd iam calling this adapter in my activity , when i change the orientation when my dailog is up ,dailog is getting destroyed .i tried </p>

<pre><code>&lt;activity android:name=".activity.SearchAttraction" android:configChanges="keyboardHidden|orientation|screenLayout|screenSize" /&gt;
</code></pre>

<p>and     </p>

<pre><code>    @Override
        public void onConfigurationChanged(Configuration newConfig) {
            super.onConfigurationChanged(newConfig);

        }
   Noting is working, getting error at line `dialog.show();`    

public void performAction(View v, Activity activity) {

        Context myContext = v.getContext();
        PopUpMenu popUpMenu = (PopUpMenu) v.getTag();
        String result = popUpMenu.getMenuName();
        if (result != null
                &amp;&amp; result.equalsIgnoreCase(myContext.getResources().getString(
                        R.string.savecurrentlocation))) {
            getCurrentLocation();

        }
        // For Manage Menu..
        else if (result != null
                &amp;&amp; result.equalsIgnoreCase(myContext.getResources().getString(
                        R.string.addnewplace))) {
            AttractionData attractionData = new AttractionData();
            createDiloag(attractionData,
                    activity.getResources().getString(R.string.addnewplace));
            this.activity.finish();

        }
        // For About Us..
        else if (result != null
                &amp;&amp; result.equalsIgnoreCase(myContext.getResources().getString(
                        R.string.fromaddressbook))) {

            Intent callIntent = new Intent(activity, ProfileActivity.class);
            callIntent.putExtra("ProfileType", Constants.FROM_CONTATCS);
            Log.d(TAG, "start to call On Activity Result Method : ");
            parentActivity.startActivityForResult(callIntent, 100);
            Log.d(TAG, "end to call On Activity Result Method : ");
            this.activity.finish();

        }

        else if (result != null
                &amp;&amp; result.equalsIgnoreCase(myContext.getResources().getString(
                        R.string.distancebetween))) {
            AttractionService service = AttractionService
                    .getInstance(parentActivity.getApplicationContext());
            ArrayList&lt;AttractionData&gt; allMenuSearchList = service
                    .getAllAttractions(true, Constants.field, Constants.order);

            if (allMenuSearchList != null &amp;&amp; !allMenuSearchList.isEmpty()) {

                dialog.setContentView(R.layout.pickdestination);
                ListView listPlace = (ListView) dialog
                        .findViewById(R.id.listPlace);
                PlaceAdapter placeAdapter = new PlaceAdapter(parentActivity,
                        allMenuSearchList, R.layout.pickcity, dialog,
                        R.string.pickstartingpoint, null);
                listPlace.setAdapter(placeAdapter);
                dialog.show();

            } else {
                Toast.makeText(parentActivity, R.string.nonavigationtolink,
                        Toast.LENGTH_SHORT).show();

            }

            this.activity.finish();
        }
</code></pre>

<p>this is my log</p>

<pre><code>01-30 16:38:31.690: E/WindowManager(2791): android.view.WindowLeaked: Activity org.app.mycity.activity.ABActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@420c3948 that was originally added here
01-30 16:38:31.690: E/WindowManager(2791):  at android.view.ViewRootImpl.&lt;init&gt;(ViewRootImpl.java:412)
01-30 16:38:31.690: E/WindowManager(2791):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:312)
01-30 16:38:31.690: E/WindowManager(2791):  at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:224)
01-30 16:38:31.690: E/WindowManager(2791):  at android.view.WindowManagerImpl$CompatModeWrapper.addView(WindowManagerImpl.java:149)
01-30 16:38:31.690: E/WindowManager(2791):  at android.view.Window$LocalWindowManager.addView(Window.java:554)
01-30 16:38:31.690: E/WindowManager(2791):  at android.app.Dialog.show(Dialog.java:277)
01-30 16:38:31.690: E/WindowManager(2791):  at org.appright.myneighborhood.adaptor.AddressPopUpAdapter.performAction(AddressPopUpAdapter.java:169)
01-30 16:38:31.690: E/WindowManager(2791):  at org.appright.myneighborhood.adaptor.AddressPopUpAdapter$1.onClick(AddressPopUpAdapter.java:93)
</code></pre>

<p>i am struck, Any help is appreciated.</p>
