Fix BrowseFragmentTest

Change-Id: I3009e1d11a2b9b38c9562daa357eb3749aeebd8d
(cherry picked from commit d89094b31b55d54d2f3b1f502b15ddbff9e878ca)
diff --git a/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseFragmentTest.java b/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseFragmentTest.java
index 8809861..3bcc838 100644
--- a/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseFragmentTest.java
+++ b/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseFragmentTest.java
@@ -59,7 +59,7 @@
         Intent intent = new Intent();
         intent.putExtra(BrowseFragmentTestActivity.EXTRA_LOAD_DATA_DELAY, dataLoadingDelay);
         intent.putExtra(BrowseFragmentTestActivity.EXTRA_ADD_TO_BACKSTACK , true);
-        activityTestRule.launchActivity(intent);
+        mActivity = activityTestRule.launchActivity(intent);
 
         Thread.sleep(dataLoadingDelay + TRANSITION_LENGTH);
 
@@ -75,7 +75,7 @@
         Intent intent = new Intent();
         intent.putExtra(BrowseFragmentTestActivity.EXTRA_LOAD_DATA_DELAY, dataLoadingDelay);
         intent.putExtra(BrowseFragmentTestActivity.EXTRA_ADD_TO_BACKSTACK , false);
-        activityTestRule.launchActivity(intent);
+        mActivity = activityTestRule.launchActivity(intent);
 
         Thread.sleep(dataLoadingDelay + TRANSITION_LENGTH);
 
@@ -91,7 +91,7 @@
         Intent intent = new Intent();
         intent.putExtra(BrowseFragmentTestActivity.EXTRA_LOAD_DATA_DELAY, dataLoadingDelay);
         intent.putExtra(BrowseFragmentTestActivity.EXTRA_ADD_TO_BACKSTACK , false);
-        activityTestRule.launchActivity(intent);
+        mActivity = activityTestRule.launchActivity(intent);
 
         assertNull(mActivity.getBrowseTestFragment().getMainFragment());
         sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);
diff --git a/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseSupportFragmentTest.java b/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseSupportFragmentTest.java
index 14c5011..10ea0c6 100644
--- a/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseSupportFragmentTest.java
+++ b/v17/leanback/tests/java/android/support/v17/leanback/app/BrowseSupportFragmentTest.java
@@ -61,7 +61,7 @@
         Intent intent = new Intent();
         intent.putExtra(BrowseSupportFragmentTestActivity.EXTRA_LOAD_DATA_DELAY, dataLoadingDelay);
         intent.putExtra(BrowseSupportFragmentTestActivity.EXTRA_ADD_TO_BACKSTACK , true);
-        activityTestRule.launchActivity(intent);
+        mActivity = activityTestRule.launchActivity(intent);
 
         Thread.sleep(dataLoadingDelay + TRANSITION_LENGTH);
 
@@ -77,7 +77,7 @@
         Intent intent = new Intent();
         intent.putExtra(BrowseSupportFragmentTestActivity.EXTRA_LOAD_DATA_DELAY, dataLoadingDelay);
         intent.putExtra(BrowseSupportFragmentTestActivity.EXTRA_ADD_TO_BACKSTACK , false);
-        activityTestRule.launchActivity(intent);
+        mActivity = activityTestRule.launchActivity(intent);
 
         Thread.sleep(dataLoadingDelay + TRANSITION_LENGTH);
 
@@ -93,7 +93,7 @@
         Intent intent = new Intent();
         intent.putExtra(BrowseSupportFragmentTestActivity.EXTRA_LOAD_DATA_DELAY, dataLoadingDelay);
         intent.putExtra(BrowseSupportFragmentTestActivity.EXTRA_ADD_TO_BACKSTACK , false);
-        activityTestRule.launchActivity(intent);
+        mActivity = activityTestRule.launchActivity(intent);
 
         assertNull(mActivity.getBrowseTestSupportFragment().getMainFragment());
         sendKeys(KeyEvent.KEYCODE_DPAD_RIGHT);