Main Activity is not garbage collected after destruction because it is referenced by InputMethodManager indirectly
It seems that calling InputMethodManager’s methods ‘windowDismissed’ and ‘startGettingWindowFocus’ do the stuff. Something like this: @Override protected void onDestroy() { super.onDestroy(); //fix for memory leak: http://code.google.com/p/android/issues/detail?id=34731 fixInputMethodManager(); } private void fixInputMethodManager() { final Object imm = getSystemService(Context.INPUT_METHOD_SERVICE); final Reflector.TypedObject windowToken = new Reflector.TypedObject(getWindow().getDecorView().getWindowToken(), IBinder.class); Reflector.invokeMethodExceptionSafe(imm, “windowDismissed”, windowToken); final Reflector.TypedObject view = new Reflector.TypedObject(null, View.class); Reflector.invokeMethodExceptionSafe(imm, … Read more