title: NullPointerException while using GridViewPager class on Android Wear
body: <p>I have a problem with using GridViewPager for Android Wear. When adding it to my layout Android Studio says that there is no such class (Null Pointer Exception). What am I doing wrong? I'm  using Android Studio 0.8.2 and I have choosen Wear application via wizard. 
  Here is my code:</p>
  
  <p>Layout:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:orientation="vertical"
  tools:context=".MyActivity"
  tools:deviceIds="wear_square"&gt;
  
  &lt;android.support.wearable.view.GridViewPager
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@+id/pager"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      android:keepScreenOn="true" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>and my error:</p>
  
  <pre><code>FATAL EXCEPTION: main
  Process: eu.nalewczynski.weargsdgs, PID: 10653
  java.lang.NullPointerException
          at android.support.wearable.view.GridViewPager.populate(GridViewPager.java:900)
          at android.support.wearable.view.GridViewPager.populate(GridViewPager.java:848)
          at android.support.wearable.view.GridViewPager.onMeasure(GridViewPager.java:1141)
          at android.view.View.measure(View.java:16648)
          at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
          at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1404)
          at android.widget.LinearLayout.measureVertical(LinearLayout.java:695)
          at android.widget.LinearLayout.onMeasure(LinearLayout.java:588)
          at android.view.View.measure(View.java:16648)
          at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
          at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
          at android.support.wearable.view.WatchViewStub.onMeasure(WatchViewStub.java:143)
          at android.view.View.measure(View.java:16648)
          at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
          at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
          at android.view.View.measure(View.java:16648)
          at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:5125)
          at android.widget.FrameLayout.onMeasure(FrameLayout.java:310)
          at com.android.internal.policy.impl.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2321)
          at android.view.View.measure(View.java:16648)
          at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:1959)
          at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1145)
          at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1340)
          at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1032)
          at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:5657)
          at android.view.Choreographer$CallbackRecord.run(Choreographer.java:761)
          at android.view.Choreographer.doCallbacks(Choreographer.java:574)
          at android.view.Choreographer.doFrame(Choreographer.java:544)
          at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:747)
          at android.os.Handler.handleCallback(Handler.java:733)
          at android.os.Handler.dispatchMessage(Handler.java:95)
          at android.os.Looper.loop(Looper.java:136)
          at android.app.ActivityThread.main(ActivityThread.java:5026)
          at java.lang.reflect.Method.invokeNative(Native Method)
          at java.lang.reflect.Method.invoke(Method.java:515)
          at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:777)
          at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
          at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>My full java code is barely untouched:</p>
  
  <pre><code>import android.app.Activity;
  import android.os.Bundle;
  import android.support.wearable.view.GridViewPager;
  import android.support.wearable.view.WatchViewStub;
  
  public class MyActivity extends Activity {
  
  GridViewPager gvp;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_my);
      final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub);
      stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() {
          @Override
          public void onLayoutInflated(WatchViewStub stub) {
              //blahblahblah
          }
      });
  }
  </code></pre>
  
  <p>}</p>