app.SendIntent passing params?

28 views
Skip to first unread message

wheelie tips

unread,
Dec 8, 2021, 12:27:55 AM12/8/21
to DroidScript
Hello,
I have two apps, testA, and testB; I'm calling testB from testA using the "app.SendIntent":

var packageName = "com.myname.testb";
var className = null;
var action = "android.intent.action.MAIN";
var uri = null;
app.SendIntent( packageName, className, action, null, uri );

Is there a way to pass parameters from testA to testB in the above uri params (or in a different way)? And if so, how to read the given parameters at the testB side?

Thx much in advance,
WT

Message has been deleted

wheelie tips

unread,
Dec 8, 2021, 1:25:08 AM12/8/21
to DroidScript
ok, got it:

    var packageName = "com.myname.testb";
    var className   = null;
    var action      = "android.intent.action.MAIN";
    var uri         = null;
    var extras      = [{name:"Ver", type:"String", value:"100"}];
    extras = JSON.stringify( extras );
    app.SendIntent( packageName, className, action, null, uri, null, extras );   

on testB I added:
var int = app.GetIntent();
app.Alert( JSON.stringify( int ));

alert.png
Reply all
Reply to author
Forward
0 new messages