当前位置: 首页>>代码示例>>Java>>正文


Java SearchFragment类代码示例

本文整理汇总了Java中android.support.v17.leanback.app.SearchFragment的典型用法代码示例。如果您正苦于以下问题:Java SearchFragment类的具体用法?Java SearchFragment怎么用?Java SearchFragment使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


SearchFragment类属于android.support.v17.leanback.app包,在下文中一共展示了SearchFragment类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onCreate

import android.support.v17.leanback.app.SearchFragment; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:googlesamples,项目名称:leanback-showcase,代码行数:19,代码来源:SearchActivity.java

示例2: onKeyDown

import android.support.v17.leanback.app.SearchFragment; //导入依赖的package包/类
/**
 * Catch the SEARCH key so that the general Android TV search is not launched.
 * Try to relaunch the show name search instead
 * @param keyCode
 * @param event
 * @return
 */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH) {
        Fragment f = getFragmentManager().findFragmentById(R.id.fragment);
        if (f instanceof SearchFragment) {
            ((SearchFragment)f).startRecognition();
            return true;
        }
    }
    return super.onKeyDown(keyCode, event); // default
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:19,代码来源:ManualShowScrappingActivity.java

示例3: onKeyDown

import android.support.v17.leanback.app.SearchFragment; //导入依赖的package包/类
/**
 * Catch the SEARCH key so that the general Android TV search is not launched.
 * Try to relaunch the movie name search instead
 * @param keyCode
 * @param event
 * @return
 */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH) {
        Fragment f = getFragmentManager().findFragmentById(R.id.fragment);
        if (f instanceof SearchFragment) {
            ((SearchFragment)f).startRecognition();
            return true;
        }
    }
    return super.onKeyDown(keyCode, event); // default
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:19,代码来源:ManualVideoScrappingActivity.java

示例4: onKeyDown

import android.support.v17.leanback.app.SearchFragment; //导入依赖的package包/类
/**
 * Catch the SEARCH key so that the general Android TV search is not launched.
 * Try to relaunch the AVP search instead
 * @param keyCode
 * @param event
 * @return
 */
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (event.getKeyCode() == KeyEvent.KEYCODE_SEARCH) {
        Fragment f = getFragmentManager().findFragmentById(R.id.video_search_fragment);
        if (f instanceof SearchFragment) {
            ((SearchFragment)f).startRecognition();
            return true;
        }
    }
    return super.onKeyDown(keyCode, event); // default
}
 
开发者ID:archos-sa,项目名称:aos-Video,代码行数:19,代码来源:VideoSearchActivity.java


注:本文中的android.support.v17.leanback.app.SearchFragment类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。