android.widget.GridView.getSelectedItemPosition()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(1.1k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中android.widget.GridView.getSelectedItemPosition()方法的一些代码示例,展示了GridView.getSelectedItemPosition()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GridView.getSelectedItemPosition()方法的具体详情如下:
包路径:android.widget.GridView
类名称:GridView
方法名:getSelectedItemPosition

GridView.getSelectedItemPosition介绍

暂无

代码示例

代码示例来源:origin: arnabc/simplelauncher

/**
 * Get the position of the currently selected grid item.
 */
public int getSelectedItemPosition() {
  ensureGrid();
  return mGrid.getSelectedItemPosition();
}

代码示例来源:origin: sphinx02/AppStarter

final AppInfo appInfo = (AppInfo) ((InstalledAppsAdapter) mGridView.getAdapter()).getItem(mGridView.getSelectedItemPosition());
final AppSettingsOverlayDialog appSettingsDialog = newInstance(appInfo);

代码示例来源:origin: MoMoWait/LeanbackLauncher

}else if(keyCode == KeyEvent.KEYCODE_DPAD_UP){
  int numCols = mAllAppGridView.getNumColumns();
  int selectedPosition = mAllAppGridView.getSelectedItemPosition();
  if(selectedPosition / numCols == 0)
    return  true;
}else if(keyCode == KeyEvent.KEYCODE_DPAD_RIGHT){
  int selectedPosition = mAllAppGridView.getSelectedItemPosition();
  if(selectedPosition == mAllAppGridView.getAdapter().getCount() - 1)
    return true;

相关文章

GridView类方法