Re-organized activity_edit_text

(Old Android versions throw an exception if you try to set a field marked as final using reflection.)
This commit is contained in:
Olga Miller 2017-03-11 16:11:21 +01:00
parent ea1eb2775e
commit d889bb574c

View file

@ -19,6 +19,7 @@ import android.graphics.Color;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.lang.reflect.Modifier;
public class Label implements Serializable {
public static final float TEXT_SIZE_NORMAL = 2f;
@ -128,6 +129,7 @@ public class Label implements Serializable {
Label clone = new Label();
try {
for (Field field : getClass().getDeclaredFields()) {
if (!Modifier.isFinal(field.getModifiers()))
field.set(clone, field.get(this));
}
} catch (Exception ignore) {