【发布时间】:2015-05-04 21:02:01
【问题描述】:
我正在尝试使用自定义意图过滤器来调用 android wear 活动。 (不确定这是不是最好的主意?)但是,在穿戴应用程序上注册意图过滤器并部署移动应用程序后,我收到错误:
Applications have the same package name com.nybblemouse.datalayerdatamap:
mobile, wear
谁能给点建议?
背景资料:
我正在开发一个 Android Wear 应用程序,它使用数据层 API 允许 http 连接访问一个简单的 API 并在手表应用程序上显示响应。
我已经使用数据层 API 成功要求移动应用进行调用,现在想调用手表上的 Activity 以显示结果。
Android Wear 清单:
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.DeviceDefault" >
<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>
<intent-filter>
<action android:name="com.nybblemouse.datalayerdatamap.MainActivity" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<service android:name=".ListenerService">
<intent-filter>
<action android:name="com.google.android.gms.wearable.BIND_LISTENER" />
</intent-filter>
</service>
</application>
在我的单独监听服务类(用于数据层api)中,http响应成功后:
Intent chilliIntent = new Intent();
chilliIntent.setAction("com.nybblemouse.datalayerdatamap.MainActivity");
chilliIntent.putExtra("CHILLIS", "10");
startActivity(chilliIntent);
【问题讨论】:
标签: java android android-studio wear-os