Code example for GridView

Methods: setAdapter, setOnItemClickListener

0
  } 
 
  private void initializeEmojiGrid() { 
    emojiGrid.setAdapter(new EmojiGridAdapter(ALL_TYPE));
    emojiGrid.setOnItemClickListener(new EmojiClickListener(ALL_TYPE));
    recentEmojiGrid.setAdapter(new EmojiGridAdapter(RECENT_TYPE));
    recentEmojiGrid.setOnItemClickListener(new EmojiClickListener(RECENT_TYPE));
 
    pager.setAdapter(new EmojiPagerAdapter());
 
    if (emoji.getRecentlyUsedAssetCount() <= 0) {
      pager.setCurrentItem(1);
    } 
  } 
 
  private class EmojiClickListener implements AdapterView.OnItemClickListener {
 
    private final int type;
 
    public EmojiClickListener(int type) {
      this.type = type;