Skip to content Skip to sidebar Skip to footer

Android.view.windowleaked - While Using Dialog & New Intent

I have tried all possible solutions provided at stackoverflow. But I am still sitting with this error in logcat: 'Activity com.xyz.MainActivity has leaked window com.android.intern

Solution 1:

Don't you forget return operator in first case?

if (Var_place_holder.level.equals("one")) {
       Var_place_holder.title=obj_itemDetails.getTitle();
       Var_place_holder.level="two";
       Intent intent = getIntent();
       dialog.dismiss();
       finish();
       startActivity(intent);
       return;
} 

Now you are trying to start new activity (and stops current one) and after that preparing ans showing dialog attached to first already stopped activity.

Post a Comment for "Android.view.windowleaked - While Using Dialog & New Intent"