Start android activity from cordova plugin

前端 未结 2 1339
醉酒成梦
醉酒成梦 2020-12-13 02:56

I know this may is a duplicate question, i have tried all answers from stack, but non has a complete answer.

Most answers just give how to start an activity but no h

2条回答
  •  心在旅途
    2020-12-13 03:47

    Hi you can use this plugin

    cordova plugin add sevensky-cordova-plugin-intent
    

    Usage :

        document.getElementById("btn_device_name").addEventListener("click", test);
    
        function test() {
            var obj = new Object();
            obj.name = "Ahmad"; //bundle string extra 1 string
            obj.family = "Aghazadeh"; //bundle string extra 2
            intentPlugin.startActivity("com.sevensky.test", "TestActivity", JSON.stringify(obj));
        }
    

提交回复
热议问题