In my monodroid application I have an activity that users may roatate it.
when several time back to back i rotate it it cause this error:
12-17 11:58:40.367: E/WindowManager(2115): Activity myapp.myActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405bc398 that was originally added here
12-17 11:58:40.367: E/WindowManager(2115): android.view.WindowLeaked: Activity myapp.myActivity has leaked window com.android.internal.policy.impl.PhoneWindow$DecorView@405bc398 that was originally added here
12-17 11:58:40.367: E/WindowManager(2115): at android.view.ViewRoot.<init>(ViewRoot.java:275)
12-17 11:58:40.367: E/WindowManager(2115): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148)
12-17 11:58:40.367: E/WindowManager(2115): at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91)
12-17 11:58:40.367: E/WindowManager(2115): at android.view.Window$LocalWindowManager.addView(Window.java:430)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.Dialog.show(Dialog.java:288)
12-17 11:58:40.367: E/WindowManager(2115): at myapp.myActivity.n_onCreate(Native Method)
12-17 11:58:40.367: E/WindowManager(2115): at myapp.myActivity.onCreate(PropertyShowActivity.java:77)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1093)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1780)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1837)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.ActivityThread.handleRelaunchActivity(ActivityThread.java:3242)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.ActivityThread.access$1600(ActivityThread.java:132)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1037)
12-17 11:58:40.367: E/WindowManager(2115): at android.os.Handler.dispatchMessage(Handler.java:99)
12-17 11:58:40.367: E/WindowManager(2115): at android.os.Looper.loop(Looper.java:143)
12-17 11:58:40.367: E/WindowManager(2115): at android.app.ActivityThread.main(ActivityThread.java:4196)
12-17 11:58:40.367: E/WindowManager(2115): at java.lang.reflect.Method.invokeNative(Native Method)
12-17 11:58:40.367: E/WindowManager(2115): at java.lang.reflect.Method.invoke(Method.java:507)
12-17 11:58:40.367: E/WindowManager(2115): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
12-17 11:58:40.367: E/WindowManager(2115): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
12-17 11:58:40.367: E/WindowManager(2115): at dalvik.system.NativeStart.main(Native Method)
12-17 11:58:40.377: W/MapActivity(2115): Recycling dispatcher android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher@40626398
i dont know for what is this.
can any body help me?
I have also this info before the above errors:
Recycling dispatcher android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher@40626398
Recycling map object.
Clamp target GC heap from 33.796MB to 32.000MB
395280-byte external allocation too large for this process.
VM won’t let us allocate 395280 bytes
Clamp target GC heap from 33.789MB to 32.000MB
i have some images in my activity that loads with Universal Image Loader
is it because of them?
if its true how i can resolve this?
If you are not changing the layout or needing to reconfigure/reload controls or your layout, you might want to look into adding an attribute change like this:
The Android.Content.PM.ConfigChanges.Orientation property notifies the activity that any orientation changes will need to be handled manually. So, if you just want the view to rotate without restarting your activity, making that attribute change should solve your problem.
If you will be needing to change your layout or need to take actions on the orientation change, you will want to override the OnConfigurationChanged method.
More information on this process can be found at the Xamarin Docs Site. Look at the Section “Preventing Activity Restart”.