gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-30 02:27:08 24 4
gpt4 key购买 nike

嗨,我正在关注 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com