Reputation: 33
I have configured webintent plugin in my android app . I want to start an activity from a button click on my UI page . The activity takes no params . I have gone through this link https://github.com/phonegap/phonegap-plugins/tree/master/Android/WebIntent/ but i m not getting how to call a such a simple activity . Not able to get the what url field is used for .... . One more , are thing any configuration required in manifest file such as intent filters for calling activity .
Upvotes: 1
Views: 7564
Reputation: 58
Not sure if that could help :
https://github.com/phonegap/phonegap-plugins/issues/1009
https://github.com/Richardsonke/phonegap-plugins/commit/d0343f49022d9ece97f70af42400636d8d0a64d8
EDIT 1: Ok I got it working now, in your AndroidManifest.xml add these Lines ( Inside the Activity you want the Button to go to )
<intent-filter>
<action android:name="com.example.yourapplication.UNIQUESTRING" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
be sure to change "com.example.yourapplication" to your package and UNIQUESTRING to be something Unique
in Javascript make the button fires this JS :
window.plugins.webintent.startActivity(
{
action: 'com.example.yourapplication.UNIQUESTRING',
},
function() {},
function() {alert('Failed to open URL via Android Intent')}
);
Upvotes: 3