leakCanary检测到ClipboardUIManager内存泄漏
通过上网查资料发现如下解决方法:
try {
/**
* 三星手机泄漏内存(editText),我的手机
* */
if ("samsung".equalsIgnoreCase(Build.MANUFACTURER) &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT &&
Build.VERSION.SDK_INT <= Build.VERSION_CODES.LOLLIPOP) {
Class cls = Class.forName("android.sec.clipboard.ClipboardUIManager");
Method m = cls.getDeclaredMethod("getInstance", Context.class);
m.setAccessible(true);
Object o = m.invoke(null, getApplicationContext());
}
} catch (Throwable e) {
e.printStackTrace();
}