一、搭建环境
1、将SDK升级到23
2、建android wear模拟器
根据以前创建模拟器的方式一样
3、启动模拟器,这个过程有点慢,要等一下
二、创建一个helloworld android wear工程
1、用图说话
一路next,就OK了
2、创建完的工程你会发现报错,解决办法为
3、代码为
4、运行过程中遇到的错误
Caused by: android.util.AndroidRuntimeException: You cannot combine swipe dismissal and the action bar.
styles.xml 文件改为<style name="AppBaseTheme" parent="android:Theme.DeviceDefault">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
Caused by: java.lang.NoClassDefFoundError: android.support.wearable.R$styleable
at android.support.wearable.view.WatchViewStub.<init>(WatchViewStub.java:52)
at android.support.wearable.view.WatchViewStub.<init>(WatchViewStub.java:46)
have not included the support-wearable lib project