Last active
June 17, 2017 15:32
-
-
Save pszklarska/a9fb395031a24c91631ba0d0b101c421 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package pl.pszklarska.leakexample; | |
public class InnerClassLeakActivity extends AppCompatActivity { | |
@Override | |
protected void onCreate(@Nullable final Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
InnerClass innerClassInstance = new InnerClass(); | |
innerClassInstance.showToast(); | |
} | |
private class InnerClass { | |
void showToast() { | |
new Handler().postDelayed(() -> makeSomeAction(), TimeUnit.MINUTES.toMillis(10)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment