我在git link上有一个示例(它并不复杂)
中有
VerticalSeekBar
类和方法setProgress()
private synchronized void setProgress(int progress, boolean fromUser) {
if (mMethodSetProgress == null) {
try {
Method m;
m = this.getClass().getMethod("setProgress", int.class, boolean.class);
m.setAccessible(true);
mMethodSetProgress = m;
} catch (NoSuchMethodException ignored) {
}
}
if (mMethodSetProgress != null) {
try {
mMethodSetProgress.invoke(this, progress, fromUser);
} catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException ignored) {
}
} else {
super.setProgress(progress);
}
refreshThumb();
}
问题是 - 如果compileSdkVersion
- 23一切正常,但如果compileSdkVersion
- 24,IDEA说我需要更改private
到public
,一切都已完成。我启动我的应用程序并没有任何工作,因为我的更改方法setProgress()
调用自己,最后我得到无限循环......
请帮助我,我如何将compileSdkVersion
更改为24?