O'Reilly logo

Mastering Android Studio 3 by Kyle Mew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

The WatchViewStub class

The blank Wear activity template applies the first technique we discussed earlier for managing different device shapes. This takes the form of the WatchViewStub class, which can be found in the wear/src/main/res/layout folder.

<?xml version="1.0" encoding="utf-8"?> <android.support.wearable.view.WatchViewStub xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:app="http://schemas.android.com/apk/res-auto"     xmlns:tools="http://schemas.android.com/tools"     android:id="@+id/watch_view_stub"     android:layout_width="match_parent"     android:layout_height="match_parent"     app:rectLayout="@layout/rect_activity_main"     app:roundLayout="@layout/round_activity_main"  tools:context="com.mew.kyle.wearable.MainActivity" ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required