samples/SupportLeanbackDemos/src/main/java/com/example/android/leanback/SearchActivity.java
@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search);

        mFragment = (SearchFragment) getFragmentManager().findFragmentById(R.id.search_fragment);

        if (!USE_INTERNAL_SPEECH_RECOGNIZER) {
            mSpeechRecognitionCallback = new SpeechRecognitionCallback() {
                @Override
                public void recognizeSpeech() {
                    if (DEBUG) Log.v(TAG, "recognizeSpeech");
                    startActivityForResult(mFragment.getRecognizerIntent(), REQUEST_SPEECH);
                }
            };
            mFragment.setSpeechRecognitionCallback(mSpeechRecognitionCallback);
        }
    }
/** Called when the activity is first created. */
Called when the activity is first created.
Called when the activity is first created .
@Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.search);
        mFragment = (SearchFragment) getFragmentManager().findFragmentById(R.id.search_fragment);
        if (!USE_INTERNAL_SPEECH_RECOGNIZER) {
            mSpeechRecognitionCallback = new SpeechRecognitionCallback() {
                @Override
                public void recognizeSpeech() {
                    if (DEBUG) Log.v(TAG, "recognizeSpeech");
                    startActivityForResult(mFragment.getRecognizerIntent(), REQUEST_SPEECH);
                }
            };
            mFragment.setSpeechRecognitionCallback(mSpeechRecognitionCallback);
        }
    }
@ Override public void onCreate ( Bundle savedInstanceState ) { super . onCreate ( savedInstanceState ) ; setContentView ( R . layout . search ) ; mFragment = ( SearchFragment ) getFragmentManager ( ) . findFragmentById ( R . id . search_fragment ) ; if ( ! USE_INTERNAL_SPEECH_RECOGNIZER ) { mSpeechRecognitionCallback = new SpeechRecognitionCallback ( ) { @ Override public void recognizeSpeech ( ) { if ( DEBUG ) Log . v ( TAG , "recognizeSpeech" ) ; startActivityForResult ( mFragment . getRecognizerIntent ( ) , REQUEST_SPEECH ) ; } } ; mFragment . setSpeechRecognitionCallback ( mSpeechRecognitionCallback ) ; } }
Called when the activity is first created.
Called when the activity is first created .