Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9214367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T01:57:38+00:00 2026-06-18T01:57:38+00:00

I have two classes one adapter and one activity, i have a dialog in

  • 0

I have two classes one adapter and one activity, i have a dialog in my adapter , amd iam calling this adapter in my activity , when i change the orientation when my dialog is up ,dialog is getting destroyed .i tried

<activity android:name=".activity.SearchAttraction" android:configChanges="keyboardHidden|orientation|screenLayout|screenSize" />

and

    @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
                && result.equalsIgnoreCase(myContext.getResources().getString(
                        R.string.savecurrentlocation))) {
            getCurrentLocation();

        }
        // For Manage Menu..
        else if (result != null
                && 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
                && 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
                && result.equalsIgnoreCase(myContext.getResources().getString(
                        R.string.distancebetween))) {
            AttractionService service = AttractionService
                    .getInstance(parentActivity.getApplicationContext());
            ArrayList<AttractionData> allMenuSearchList = service
                    .getAllAttractions(true, Constants.field, Constants.order);

            if (allMenuSearchList != null && !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();
        }

this is my log

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.<init>(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)

i am struck, Any help is appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T01:57:39+00:00Added an answer on June 18, 2026 at 1:57 am

    Basic assumption,

    I think, onConfigurationChanged(Configuration newConfig) is not called when you change the orientation, Just check it by debug or by putting log inside it.

    The parameters

    android:configChanges="keyboardHidden|orientation|screenLayout|screenSize"
    

    are not sufficient in Android 4.0+

    Try with other parameters in android:configChanges in activity tag of manifest file.

    Something like,

    android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize"
    

    Try this and let me know what happen..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two classes one adapter and one activity , i have a dailog
I have two classes, one does all the work of getting data from a
I have two classes, one is a standard activity , the other a service
I have two classes, one depends on another. It is implemented like this: class
Note: This is a homework assignment. I have two classes, one inherits from the
I have two classes one of which inherits from the other. Im trying to
I have two classes (MVC view model) which inherits from one abstract base class.
I have two classes, one that inherits from the other. The base class is
Starting to learn Canvas and have two classes so far (main one to call
First I want to describe my situation briefly. I have two classes, one MainClass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.