Crash loading WearableActivity

懵懂的女人 提交于 2019-12-01 21:32:00

Without seeing your AndroidManifest the only suggestion I can make is the following:

uses-library should be application level, not manifest level. Your AndroidManifest should look like this:

<manifest
    package="com.yourpackage.app_package"
    xmlns:android="http://schemas.android.com/apk/res/android">

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:theme="@android:style/Theme.DeviceDefault">

        <uses-library android:name="com.google.android.wearable" android:required="false" />

        <activity
        ....
        </activity>
   </application>
</manifest>

Consider: http://developer.android.com/guide/topics/manifest/uses-library-element.html

Might want to useAmbientMode.AmbientCallbackProvider instead of WearableActivity.

It is the new preferred method and it still gives you all the stuff with WearableActivity but you can keep using AppCompatActivity.

Official docs call out the details (and example code).

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!