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

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

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

GridView.setSelection介绍

暂无

代码示例

代码示例来源:origin: wangdan/AisenWeiBo

@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
  super.onActivityResult(requestCode, resultCode, data);
  if (Activity.RESULT_OK == resultCode && requestCode == 1000) {
    int index = data.getIntExtra("index", 0);
    getRefreshView().setSelection(index);
  }
}

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

/**
 * Set the currently selected grid item to the specified
 * position with the adapter's data
 *
 * @param position
 */
public void setSelection(int position) {
  ensureGrid();
  mGrid.setSelection(position);
}

代码示例来源:origin: stackoverflow.com

final GridView filters = (GridView) child.findViewById(R.id.filter_gridview);
final WeedFilterGridViewAdapter adapter = new WeedFilterGridViewAdapter(this, values);
filters.setAdapter(adapter);
filters.setSelection(0);
// add this line
filters.setItemChecked(0, true);

代码示例来源:origin: stackoverflow.com

static int index;
private GridView gridView;

@Override
public void onResume(){

  gridView.setSelection(index);
  super.onResume();
}

@Override
public void onPause(){  
  index = gridView.getFirstVisiblePosition();
  super.onPause();
}

代码示例来源:origin: GoBelieveIO/im_android

private void initView() {
  gridView = (GridView) this.findViewById(R.id.child_grid);
  mGridAdapter = new GalleryGridAdapter(GalleryGridUI.this, imagesList, DisplayUtils.getScreenWidth(this));
  gridView.setAdapter(mGridAdapter);
  gridView.setSelection(initialPosition);
  gridView.setOnItemClickListener(new OnItemClickListener() {
    @Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
      navigateToViewImageDetail(position);
    }
  });
}

代码示例来源:origin: HenriDellal/emerald

@Override
    public void onClick(DialogInterface arg0, int arg1) {
      for (int i = 0 ; i < nCategories ; i++) {
        if (checked[i] && ! oldChecked[i])
          DatabaseHelper.addToCategory(Apps.this, item, editableCategoriesArray[i]);
        else if (!checked[i] && oldChecked[i])
          DatabaseHelper.removeFromCategory(Apps.this, item, editableCategoriesArray[i]);
      }
      loadFilteredApps();
      grid.setSelection(position);
    }});
}

代码示例来源:origin: googlecodelabs/android-topeka

private void setUpUserInput() {
  mAnswerView.performItemClick(mAnswerView.getChildAt(mAnswered), mAnswered,
      mAnswerView.getAdapter().getItemId(mAnswered));
  mAnswerView.getChildAt(mAnswered).setSelected(true);
  mAnswerView.setSelection(mAnswered);
}

代码示例来源:origin: lime-ime/limeime

this.adapter.setList(relatedlist);
  this.adapter.notifyDataSetChanged();
  this.gridManageRelated.setSelection(0);
this.gridManageRelated.setSelection(0);
Toast.makeText(activity, R.string.no_search_result, Toast.LENGTH_SHORT).show();

代码示例来源:origin: lime-ime/limeime

this.adapter.setList(wordlist);
  this.adapter.notifyDataSetChanged();
  this.gridManageIm.setSelection(0);
this.gridManageIm.setSelection(0);
Toast.makeText(activity, R.string.no_search_result, Toast.LENGTH_SHORT).show();

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

mGridView.setSelection(0);

代码示例来源:origin: jelic98/dynamico

gridView.setSelection(attributes.getInt("selection"));

代码示例来源:origin: evilbinary/TvWidget

myAdapter.notifyDataSetChanged();
 gridView.setSelection(0);
gridView.setSelected(false);
gridView.setFocusable(false);

代码示例来源:origin: chengzichen/KrGallery

listView.setSelection(position);

相关文章

GridView类方法