GridView setSelection - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for GridView setSelection method.

This code example shows how to use the following methods: setAdapter, setSelection, setEmptyView, setOnItemClickListener
     */ 
    public void setGridAdapter(ListAdapter adapter) {
        final boolean hadAdapter = (mAdapter != null);
        mAdapter = adapter;
        if (mGrid != null) {
            mGrid.setAdapter(adapter);
            if (!mGridShown && !hadAdapter) {
                // The grid was hidden, and previously didn't have an 
                // adapter.  It is now time to show it. 
                setGridShown(true, (getView().getWindowToken() != null));
            } 
        } 
    } 
 
    /** 
     * Set the currently selected grid item to the specified 
     * position with the adapter's data 
     * 
     * @param position 
     */ 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: invalidate, setAdapter, setSelection
				case ITEM_FULLSCREEN:// ȫ��
 
					break; 
				case ITEM_MORE:// ��ҳ
					if (isMore) {
						menuGrid.setAdapter(getMenuAdapter(menu_name_array2,
								menu_image_array2));
						isMore = false;
					} else {// ��ҳ 
						menuGrid.setAdapter(getMenuAdapter(menu_name_array,
								menu_image_array));
						isMore = true;
					} 
					menuGrid.invalidate();// ����menu
					menuGrid.setSelection(ITEM_MORE);
					break; 
				} 
				 
				 
			} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAdapter, setSelection, setEmptyView, setOnItemClickListener
     */ 
    public void setGridAdapter(ListAdapter adapter) {
        final boolean hadAdapter = (mAdapter != null);
        mAdapter = adapter;
        if (mGrid != null) {
            mGrid.setAdapter(adapter);
            if (!mGridShown && !hadAdapter) {
                // The grid was hidden, and previously didn't have an 
                // adapter.  It is now time to show it. 
                setGridShown(true, (getView().getWindowToken() != null));
            } 
        } 
    } 
 
    /** 
     * Set the currently selected grid item to the specified 
     * position with the adapter's data 
     * 
     * @param position 
     */ 

5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setSelection, getCount
		super.leaveSelectionMode(); 
	} 
 
	@Override 
	public void moveFolder(int position) {
		if (position >= mGridView.getCount()) {
			return; 
		} 
		mGridView.setSelection(position);
	} 
	 
    @Override 
    public boolean onDrag(View v, DragEvent event) {
        boolean flag = super.onDrag(v, event);
        switch (event.getAction()) {
        case DragEvent.ACTION_DRAG_EXITED:
        case DragEvent.ACTION_DROP:
        case DragEvent.ACTION_DRAG_ENDED:
            v.setBackgroundResource(R.drawable.folder_view_list_grid_selector);
        } 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setAdapter, setSelection, getFirstVisiblePosition
    public void onLoadFinished(Loader<MessagesArtistsResponse> loader, MessagesArtistsResponse data) {
        if(data != null){
            mAdapter.setData(data.getArtists());
            mNextPage = data.getNextPage();
        } 
        int currPostion = mGridView.getFirstVisiblePosition();
        mGridView.setAdapter(mAdapter);
        mGridView.setSelection(currPostion); //When updating adapter, it wants to scroll to top
        mProgressBar.setVisibility(View.INVISIBLE);
    } 
 
    @Override 
    public void onLoaderReset(Loader<MessagesArtistsResponse> loader) {
        mAdapter.setData(null);
    } 
 
 
    @Override 
    public void endOfListReached() { 
        // When the end of the list is reached, load the new data 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related GridView setSelection Questions & Answers:

setSelection Method Overview
Sets the currently selected item
See Code Examples for other Android GridView Methods: