Code example for GridView

Methods: setOnItemClickListener, setOnTouchListener

0
        mLoadingView = findViewById(R.id.loading_view);
    } 
 
    @Override 
    protected void setListeners() { 
        mSubSectionList.setOnItemClickListener(this);
        mSubSectionList.setOnTouchListener(new OnTouchListener() {
            @Override 
            public boolean onTouch(View v, MotionEvent event) {
                if (mDetector.onTouchEvent(event)) {
                    return true; 
                } 
                return false; 
            } 
        }); 
    } 
 
    @Override 
    public void onItemClick(AdapterView<?> parent, View view, int position,
            long id) {
        Board board = mListAdapter.getItem(position);