P Pendrush Well-Known Member Licensed User Longtime User Aug 9, 2014 #1 I have try to change INT in 'jeremyfeinstein slidingmenu lib' B4X: public static final int SLIDING_CONTENT = 0; with B4X: Dim jo As JavaObject = sm Log(jo.GetField ("SLIDING_CONTENT")) 'return 1 jo.SetField ("SLIDING_CONTENT",0) but get this error java.lang.IllegalAccessException: field is marked 'final' Is there any other way to change public static final int? Last edited: Aug 9, 2014
I have try to change INT in 'jeremyfeinstein slidingmenu lib' B4X: public static final int SLIDING_CONTENT = 0; with B4X: Dim jo As JavaObject = sm Log(jo.GetField ("SLIDING_CONTENT")) 'return 1 jo.SetField ("SLIDING_CONTENT",0) but get this error java.lang.IllegalAccessException: field is marked 'final' Is there any other way to change public static final int?
Erel B4X founder Staff member Licensed User Longtime User Aug 9, 2014 #2 You might be able to change it with Reflection library. However you really shouldn't change the value of final fields. All kinds of problems can happen from this. Upvote 0
You might be able to change it with Reflection library. However you really shouldn't change the value of final fields. All kinds of problems can happen from this.