Home | History | Annotate | Download | only in customizationsample
      1 package com.google.android.tv.setup.customizationsample;
      2 
      3 import android.content.Intent;
      4 import android.os.Bundle;
      5 import android.view.KeyEvent;
      6 
      7 /**
      8  * A HOOK_POST_NETWORK Activity which simulates checking for a system upgrade.
      9  */
     10 public class HookPostNetworkActivity extends BaseActivity {
     11 
     12     @Override
     13     public void onCreate(Bundle savedInstanceState) {
     14         super.onCreate(savedInstanceState);
     15 
     16         // Here we pretend that we are checking if an upgrade is available.
     17         // We do not make visible any UI elements; instead we allow Android TV Setup's "Please wait"
     18         // step to show under us while we figure out if an upgrade is available. That way there are
     19         // fewer transitions which is especially useful in case we have nothing important to do.
     20 
     21         registerKeyHandlerResultCancelledBack();
     22         registerKeyHandlerResultCancelledCrashDpadLeft();
     23 
     24         registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_CENTER, "with no follow-up Activity");
     25         registerKeyHandlerResultOk(KeyEvent.KEYCODE_DPAD_RIGHT, "with a follow-up Activity", new Intent(getApplicationContext(), HookPostNetworkFollowupActivity.class));
     26     }
     27 }
     28 
     29 
     30