From c238f970e7300dd6b4b236bc626b98bd78aa7907 Mon Sep 17 00:00:00 2001 From: Diego Perez Date: Wed, 9 Mar 2016 18:04:48 +0000 Subject: [PATCH] Use system property to detect Android --- src/com/esotericsoftware/kryo/util/Util.java | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/com/esotericsoftware/kryo/util/Util.java b/src/com/esotericsoftware/kryo/util/Util.java index 3ff3aa762..a0c0fe10d 100644 --- a/src/com/esotericsoftware/kryo/util/Util.java +++ b/src/com/esotericsoftware/kryo/util/Util.java @@ -24,14 +24,7 @@ /** A few utility methods, mostly for private use. * @author Nathan Sweet */ public class Util { - static public boolean isAndroid; - static { - try { - Class.forName("android.os.Process"); - isAndroid = true; - } catch (Exception ignored) { - } - } + static public boolean isAndroid = "Dalvik".equals(System.getProperty("java.vm.name")); /** Returns the primitive wrapper class for a primitive class. * @param type Must be a primitive class. */