Skip to content Skip to sidebar Skip to footer

Cordova 3 Android Plugin - How To Call A Function In Main Activity?

Edit: User QuickFix's answer worked for me. Code right at the bottom of this question. I am trying to write a Cordova 3 Android plugin that makes normal and custom Toast. However,

Solution 1:

Maybe you could put showCustomToast inside the plugin instead of inside the app?

In that case you will have to replace in the function the R.layout.layoutname and R.id.viewname with

getApplication().getResources().getIdentifier("layoutname","layout",getApplication().getPackageName());

and

getApplication().getResources().getIdentifier("viewname","id",getApplication().getPackageName());

Post a Comment for "Cordova 3 Android Plugin - How To Call A Function In Main Activity?"