SHARE
TWEET

Untitled

a guest Feb 23rd, 2019 67 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Override
  2.  
  3.     public int getItemViewType(int position)
  4.  
  5.     {
  6.  
  7.     int type;
  8.  
  9.     if (ID.get(position)== 0){
  10.         type = TYPE_ITEM1;  //type 0 for image
  11.     } else if (ID.get(position) == 1){
  12.         type = TYPE_ITEM2; //type 1 for text
  13.     }else {
  14.         type = TYPE_ITEM3; //type 2 for videos
  15.     }
  16.     return type;
  17.     }
  18. @Override
  19. public int getViewTypeCount() {
  20.     return 3;    //three different layouts to be inflated
  21. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top