I have this code in my MyClass.java : variable 'C' is the one added.
btn.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
final MyLocalClass mlc = new MyLocalClass(A, B, C);
}
}
and I want to do Junit test like this: get the instance of 'mlc' then get the "C" in 'mlc' and compare.
final Activity activity = getActivity();
Field field = MyClass.class
.getDeclaredField("mlc");
field5.setAccessible(true);
final MyLocalClassinstance = (MyLocalClass) field5
.get(activity );
But error from OS:
junit.framework.AssertionFailedError: java.lang.NoSuchFieldExceptio
Could I get the instance of a local final variable?
Thank you very much.