A recent project went live, requiring code confusion, confusing the click events of certain controls, and later found to be a afinal annotation issue. After a half-day of data, and then asked the afinal of the relevant personnel, they gave the solution is to eliminate confusion of the annotated class, so that means that basic all the activity and fragment can not be confused, this is not what I want.
Later, the anti-compilation code compared to exclude the annotated class and do not exclude the difference between the annotated class, the comparison found that those who can not click on the definition of the control code is optimized, the reason for the optimization is because after the annotation, in the code of the control's instance is not used elsewhere, so the program thought that the code is not used, it was
Know the problem that solution is, add-dontshrink in the confusion configuration, so that the code is not compressed optimization, plus it found that after the confusion of the code has not increased much, if you mind that can only exclude the annotated class or no longer use afinal annotations.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Some controls view click events are not valid after confusing project code with afinal annotations