app/src/main/java/com/zenappse/memorymatcher/GameGridFragment.java
@Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        if(gameGridCardDeck != null) {
            final Card tappedCard = (Card) parent.getItemAtPosition(position);

            if (!tappedCard.isFlipped()) {
                flipCard(view, tappedCard);
                tappedCard.setFlipped(true);

                Handler handler = new Handler();

                final Runnable runnable = new Runnable() {
                    public void run() {
                        mListener.onCardItemClickInteraction(tappedCard);
                    }
                };
                // 750ms delay so that the user can have time to view the cards before they are turned over
                handler.postDelayed(runnable, 750);
            }
        }
        Log.d(TAG, "Grid: " + gameBoard + " - Card position: " + position);
    }
/**
     * Callback method to be invoked when an item in this AdapterView has
     * been clicked.
     *
     * Implementers can call getItemAtPosition(position) if they need
     * to access the data associated with the selected item.
     *
     * @param parent   The AdapterView where the click happened.
     * @param view     The view within the AdapterView that was clicked (this
     *                 will be a view provided by the adapter)
     * @param position The position of the view in the adapter.
     * @param id       The row id of the item that was clicked.
     */
Callback method to be invoked when an item in this AdapterView has
been clicked.

Implementers can call getItemAtPosition(position) if they need
to access the data associated with the selected item.

@param parent   The AdapterView where the click happened.
@param view     The view within the AdapterView that was clicked (this
will be a view provided by the adapter)
@param position The position of the view in the adapter.
@param id       The row id of the item that was clicked.
Callback method to be invoked when an item in this AdapterView has been clicked . Implementers can call getItemAtPosition ( position ) if they need to access the data associated with the selected item . @param parent The AdapterView where the click happened . @param view The view within the AdapterView that was clicked ( this will be a view provided by the adapter ) @param position The position of the view in the adapter . @param id The row id of the item that was clicked .
@Override
    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
        if(gameGridCardDeck != null) {
            final Card tappedCard = (Card) parent.getItemAtPosition(position);
            if (!tappedCard.isFlipped()) {
                flipCard(view, tappedCard);
                tappedCard.setFlipped(true);
                Handler handler = new Handler();
                final Runnable runnable = new Runnable() {
                    public void run() {
                        mListener.onCardItemClickInteraction(tappedCard);
                    }
                };
                handler.postDelayed(runnable, 750);
            }
        }
        Log.d(TAG, "Grid: " + gameBoard + " - Card position: " + position);
    }
@ Override public void onItemClick ( AdapterView < ? > parent , View view , int position , long id ) { if ( gameGridCardDeck != null ) { final Card tappedCard = ( Card ) parent . getItemAtPosition ( position ) ; if ( ! tappedCard . isFlipped ( ) ) { flipCard ( view , tappedCard ) ; tappedCard . setFlipped ( true ) ; Handler handler = new Handler ( ) ; final Runnable runnable = new Runnable ( ) { public void run ( ) { mListener . onCardItemClickInteraction ( tappedCard ) ; } } ; handler . postDelayed ( runnable , 750 ) ; } } Log . d ( TAG , "Grid: " + gameBoard + " - Card position: " + position ) ; }
Callback method to be invoked when an item in this AdapterView has
 been clicked.
Callback method to be invoked when an item in this AdapterView has been clicked .
// 750ms delay so that the user can have time to view the cards before they are turned over