android - 磨损 : Open my app with custom voice Start command, 不工作

标签 android wear-os voice

嗨,我正在关注 Google documentation使用“开始”命令打开一个虚拟应用程序,但对我不起作用。

我使用带有移动和穿戴模块的 Android Studio 向导创建了一个新的默认项目。

除了 Wear 模块 list 中的“android:label”之外,我什么都没碰,显示为“Hola”(西类牙语你好),当我说“Iniciar Hola”(“Start Hello”)时,Wear 使用“hola”关键字。

Wear 模块或移动模块未启动。

我遗漏了什么 :'( 从 Google 文档看来很简单...

PS:我正在穿戴设备上通过 BT 进行测试

移动 list

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.basetis.wearapp" >

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

</manifest>

移动 Activity

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_main, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();

        //noinspection SimplifiableIfStatement
        if (id == R.id.action_settings) {
            return true;
        }

        return super.onOptionsItemSelected(item);
    }
}

佩戴 list

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.basetis.wearapp" >

    <uses-feature android:name="android.hardware.type.watch" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.DeviceDefault" >
        <activity
            android:name=".WearActivity"
            android:label="Hola" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

    </application>

</manifest>

磨损 Activity

public class WearActivity extends Activity {

    private TextView mTextView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_wear);
        final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
        stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
            @Override
            public void onLayoutInflated(WatchViewStub stub) {
                mTextView = (TextView) stub.findViewById(R.id.text);
            }
        });
    }
}

最佳答案

好的...启动应用程序的西类牙语单词是“Abrir”而不是“Iniciar”,但在 Wear UI 上打开应用程序的菜单条目是“Iniciar”,因此为 Google UX 团队鼓掌:'(

关于android - 磨损 : Open my app with custom voice Start command, 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27799386/

相关文章:

java - 在调试期间显示项目,否则不在 ListView 中显示项目

java - 如果可能,我如何确保我的服务能收到我的可穿戴消息?

未安装 Android Wear 应用

Android Wear PendingResult onResult 回调未被调用

android - 如何开发像会说话的汤姆猫一样的语音识别应用

android - 如何将 OK Google 语音查询连接到我的应用程序

android - 如何删除已定义的待定 Intent

Android 11(仅限)FragmentManager 崩溃 - FragmentManager 已被销毁

android - 使光标在自定义 View 中闪烁

python - 不和谐主题曲