Y ykucuk Well-Known Member Licensed User Longtime User Aug 1, 2015 #1 Hello i got this error java.lang.InstantiationException: class android.app.enterprise.license.EnterpriseLicenseManager has no zero argument constructor when i run If FirstTime Then NativeMe.InitializeNewInstance ("android.app.enterprise.license.EnterpriseLicenseManager",Null) End If Could you tell me pls which constructor i should pass to below class ? Class package android.app.enterprise.license; import android.content.Context; import org.json.JSONArray; public class EnterpriseLicenseManager { public static final int ERROR_NONE = 0; public static final int ERROR_NULL_PARAMS = 101; public static final int ERROR_UNKNOWN = 102; public static final int ERROR_INVALID_LICENSE = 201; public static final int ERROR_NO_MORE_REGISTRATION = 202; public static final int ERROR_LICENSE_TERMINATED = 203; public static final int ERROR_INVALID_PACKAGE_NAME = 204; public static final int ERROR_NOT_CURRENT_DATE = 205; public static final int ERROR_INTERNAL = 301; public static final int ERROR_INTERNAL_SERVER = 401; public static final int ERROR_NETWORK_DISCONNECTED = 501; public static final int ERROR_NETWORK_GENERAL = 502; public static final int ERROR_USER_DISAGREES_LICENSE_AGREEMENT = 601; public static final String ACTION_LICENSE_STATUS = "edm.intent.action.license.status"; public static final String EXTRA_LICENSE_STATUS = "edm.intent.extra.license.status"; public static final String EXTRA_LICENSE_ERROR_CODE = "edm.intent.extra.license.errorcode"; public static final int LICENSE_RESULT_TYPE_ACTIVATION = 800; public static final int LICENSE_RESULT_TYPE_VALIDATION = 801; public static final String EXTRA_LICENSE_RESULT_TYPE = "edm.intent.extra.license.result_type"; public static final String EXTRA_LICENSE_PERM_GROUP = "edm.intent.extra.license.perm_group"; public static final String LICENSE_LOG_DATE = "log_date"; public static final String LICENSE_LOG_API = "api_call"; EnterpriseLicenseManager() { throw new RuntimeException("Stub!"); } public static EnterpriseLicenseManager getInstance(Context context) { throw new RuntimeException("Stub!"); } public JSONArray getApiCallDataByAdmin(String packageName) { throw new RuntimeException("Stub!"); } public void activateLicense(String licenseKey) { throw new RuntimeException("Stub!"); } public void activateLicense(String licenseKey, String pkgName) { throw new RuntimeException("Stub!"); } }
Hello i got this error java.lang.InstantiationException: class android.app.enterprise.license.EnterpriseLicenseManager has no zero argument constructor when i run If FirstTime Then NativeMe.InitializeNewInstance ("android.app.enterprise.license.EnterpriseLicenseManager",Null) End If Could you tell me pls which constructor i should pass to below class ? Class package android.app.enterprise.license; import android.content.Context; import org.json.JSONArray; public class EnterpriseLicenseManager { public static final int ERROR_NONE = 0; public static final int ERROR_NULL_PARAMS = 101; public static final int ERROR_UNKNOWN = 102; public static final int ERROR_INVALID_LICENSE = 201; public static final int ERROR_NO_MORE_REGISTRATION = 202; public static final int ERROR_LICENSE_TERMINATED = 203; public static final int ERROR_INVALID_PACKAGE_NAME = 204; public static final int ERROR_NOT_CURRENT_DATE = 205; public static final int ERROR_INTERNAL = 301; public static final int ERROR_INTERNAL_SERVER = 401; public static final int ERROR_NETWORK_DISCONNECTED = 501; public static final int ERROR_NETWORK_GENERAL = 502; public static final int ERROR_USER_DISAGREES_LICENSE_AGREEMENT = 601; public static final String ACTION_LICENSE_STATUS = "edm.intent.action.license.status"; public static final String EXTRA_LICENSE_STATUS = "edm.intent.extra.license.status"; public static final String EXTRA_LICENSE_ERROR_CODE = "edm.intent.extra.license.errorcode"; public static final int LICENSE_RESULT_TYPE_ACTIVATION = 800; public static final int LICENSE_RESULT_TYPE_VALIDATION = 801; public static final String EXTRA_LICENSE_RESULT_TYPE = "edm.intent.extra.license.result_type"; public static final String EXTRA_LICENSE_PERM_GROUP = "edm.intent.extra.license.perm_group"; public static final String LICENSE_LOG_DATE = "log_date"; public static final String LICENSE_LOG_API = "api_call"; EnterpriseLicenseManager() { throw new RuntimeException("Stub!"); } public static EnterpriseLicenseManager getInstance(Context context) { throw new RuntimeException("Stub!"); } public JSONArray getApiCallDataByAdmin(String packageName) { throw new RuntimeException("Stub!"); } public void activateLicense(String licenseKey) { throw new RuntimeException("Stub!"); } public void activateLicense(String licenseKey, String pkgName) { throw new RuntimeException("Stub!"); } }
Erel B4X founder Staff member Licensed User Longtime User Aug 2, 2015 #2 This class doesn't have any public constructors. Instead: B4X: Expand Collapse Copy Dim ctxt As JavaObject ctxt.InitializeContext Dim elm As JavaObject elm = elm.InitializeStatic("android.app.enterprise.license.EnterpriseLicenseManager").RunMethod("getInstance", Array(ctxt)) Upvote 0
This class doesn't have any public constructors. Instead: B4X: Expand Collapse Copy Dim ctxt As JavaObject ctxt.InitializeContext Dim elm As JavaObject elm = elm.InitializeStatic("android.app.enterprise.license.EnterpriseLicenseManager").RunMethod("getInstance", Array(ctxt))