如果sony smartwatch被锁定,如何显示屏幕

时间:2014-09-20 04:54:27

标签: android sony sony-smartwatch

当屏幕被锁定时,如何在sony smartwatch 2中显示屏幕,就像我们使用呼叫应用程序一样。即使屏幕在我们接到电话时被锁定,也会提前显示。当我的应用程序通过控件api打开时,我能够显示此信息。但是当我的应用程序未打开且某些事件发生在我的移动应用程序中时,我必须在智能手表中显示相同的内容。我想我们可以通过隧道服务做到这一点,但我不知道如何。请帮忙

1 个答案:

答案 0 :(得分:1)

要在SmartWatch2上启动ControlExtension,有一个startRequest命令,可以这样发送:

protected void startRequest() {
    Intent intent = new Intent(Control.Intents.CONTROL_START_REQUEST_INTENT);
    sendToHostApp(intent);
}

,其中

protected void sendToHostApp(final Intent intent) {
    ExtensionUtils.sendToHostApp(mContext, mHostAppPackageName, intent);
}
  • mContext是您发送命令的活动或服务的上下文
  • mHostAppPackageName是调用的设备主机应用程序的名称,在本例中为SmartWatch2:"com.sonymobile.smartconnect.smartwatch2"

此命令将启动并显示已在您的应用程序中注册的ControlExtension