I am currently making a Cordova plugin that will have call a method which starts a tween animation on the main activity.
cordova.getActivity().customMethod();
Does not work because the plugin does not know whether the method is implemented or not. How do I do this?
Thanks!
Edit: To clarify my question a little bit better: How do I make a Cordova Plugin start an Android view-animation in the current activity?
Did you add your plugin name to plugins.xml or config.xml(as from version 2.0.0)?
like –>
Edit:
As you are simply calling a method in your activity,I wouldn’t want to write a plugin for that…but you can do that just by getting a reference from that activity in the plugin and calling the method.After all the Plugin is implemented in native Java code.But if you have implemented CordovaWebView,then instead I would rather call it directly from the javascript.
In onCreate:
In you activity:
In JS :
Do as you may like.