Skip to content

Instantly share code, notes, and snippets.

@quangson91
Forked from pepyakin/ExampleApplication.java
Created January 3, 2018 03:55
Show Gist options
  • Save quangson91/db8cc10d92fca0fb32c089cd49aa3da3 to your computer and use it in GitHub Desktop.
Save quangson91/db8cc10d92fca0fb32c089cd49aa3da3 to your computer and use it in GitHub Desktop.
Gist which should prevent leaks of Activity in ClipboardUIManager.
public class ExampleApplication extends Application {
@Override public void onCreate() {
super.onCreate();
try {
Class<?> cls = Class.forName("android.sec.clipboard.ClipboardUIManager");
Method m = cls.getDeclaredMethod("getInstance", Context.class);
Object o = m.invoke(null, this);
} catch (Exception ignored) { }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment