0

在我的应用程序中,我去了画廊并返回 onActivityresult 方法,在该方法中我打开了对话框,有时它显示对话框,有时不显示。

它显示此错误

活动 com.Iplaybook.Dashboardhome 泄露了最初添加在这里的窗口 com.android.internal.policy.impl.PhoneWindow$DecorView@40f95ff0

4

2 回答 2

0

Think of the following scenario: You open dialog box and the you open gallery. At this point, Android doesn't have enough memory so it stops your current activity. When you close the gallery, android recreates your activity and doesn't display the dialog. To check it, you can put a breakpoint in onCreate() and see if it is called when you come back from the gallery.

于 2012-12-16T11:04:58.727 回答
0

我认为您在转到 Galery 之前创建对话框并在 onActivityResult 方法中显示它。这是错误的方式。您应该只在 ActivityResult 方法中创建和显示对话框

于 2012-04-13T17:42:01.157 回答