1

从我的扩展程序中,我可以使用以下代码启动呼叫处理扩展程序:

 Intent i1 = new Intent("com.sonyericsson.extras.aef.control.START_REQUEST");
  i1.putExtra("aea_package_name", "com.sonyericsson.extras.liveware.extension.call");
  i1.setPackage("com.sonyericsson.extras.smartwatch");
  mContext.sendBroadcast(i1, "com.sonyericsson.extras.liveware.aef.HOSTAPP_PERMISSION");

但是我不能以同样的方式启动我自己的扩展,也不能启动任何其他第三方扩展:

Intent i2 = new Intent("com.sonyericsson.extras.aef.control.START_REQUEST");
  i2.putExtra("aea_package_name", "eir.log");
  i2.setPackage("com.sonyericsson.extras.smartwatch");
  mContext.sendBroadcast(i2, "com.sonyericsson.extras.liveware.aef.HOSTAPP_PERMISSION");

当从不同的应用程序调用 i2 意图时,它可以正常工作,而不是从扩展程序调用。

我很困惑。呼叫处理扩展程序是否从主机应用程序接受了一些特殊处理,或者是什么问题?

4

1 回答 1

0

I found two ways to solve this issue:

1) Trigger stopping of the current extension before invoking the other. This happens to work with the latest SmartWatch 2, but as far as I remember, it didn't work on the original SmartWatch.

What is safer to do, in case you're starting your own extensions:

2) Define a custom intent which the extension you want to start would receive (that's, of course, done in the Manifest file); then broadcast that intent from your other extension. I chose this way, also because it enables me to pass data to the extension.

Vote up, if you find this solution useful :-)

于 2013-10-10T12:20:18.727 回答