mirror of
https://github.com/apache/cordova-android.git
synced 2026-01-30 00:05:28 +08:00
fix: Deprecation warning in PluginManager for using Class.newInstance (#1823)
- Calling Class.newInstance is deprecated. Instead Class.getDeclaredConstructor().newInstance() should be called
This commit is contained in:
@@ -564,7 +564,7 @@ public class PluginManager {
|
||||
c = Class.forName(className);
|
||||
}
|
||||
if (c != null & CordovaPlugin.class.isAssignableFrom(c)) {
|
||||
ret = (CordovaPlugin) c.newInstance();
|
||||
ret = (CordovaPlugin) c.getDeclaredConstructor().newInstance();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
Reference in New Issue
Block a user