- klem_johansen
- Jul 11, 2002
-
[be my e-friend]
|
I'm trying to launch the Nook's "Shop Details" intent through phonegap (1.4.1). I'm new to Android and I'm a little confused. I need to trigger an intent with javascript. The original intent sample clode looks like this:
code:import android.content.Intent;
Intent i = new Intent();
i.setAction( "com.bn.sdk.shop.details" );
i.putExtra( "product_details_ean" , "12344567890" );
startActivity( i );
I should be able to use WebIntent, but I can't seem to get it to work. It seems to be included with PhoneGap. I can see the source
which appears to be built into PhoneGap. I can include the .js source, anyway. I saw some instructions that told me to add WebIntent.java to the project's /src/borismus folder but that just creates more errors. Am I barking up the wrong tree?
code:function seeBook(ean){
var extras = {};
extras[WebIntent.product_details_ean] = ean;
window.plugins.webintent.startActivity({
url:'',
action: 'com.bn.sdk.shop.details',
type: 'text/plain',
extras: extras
},
function() {
alert("Book link launched.");
},
function() {
alert('Failed.');
}
);
}
It looks like I'm not implementing webIntent correctly. I'm including webintent.js in my main html but I still get errors indicating that startActivity isn't declared even though I can see it right there.
klem_johansen fucked around with this message at 03:06 on Sep 14, 2012
|
#
¿
Sep 14, 2012 02:22
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 2, 2024 21:11
|
|