title: FireBasedb No properties to serialize found on class
body: <p>i am a newbie and i am trying to add some data in to the recyclerview from firbase db.but it showing the not serializable error. i searched everywhere and found couple of answers to make classes static and variables public but still not working, here  are my codes</p>
  
  <p>My Adapter</p>
  
  <pre><code> public class CardViewAdapter extends FirebaseRecyclerAdapter&lt;MainpageCardModel,CardViewAdapter.Recyclerviewholder&gt;{
      public Context mcontext;
      public List&lt;MainpageCardModel&gt; cakeslist;
      public CardViewAdapter(DatabaseReference ref){
              super(MainpageCardModel.class,R.layout.card,CardViewAdapter.Recyclerviewholder.cl    ass,ref);
  
      }
  
  
      @Override
      protected void populateViewHolder(Recyclerviewholder viewHolder,    MainpageCardModel model, int position) {
          viewHolder.ItemName.setText(MainpageCardModel.getItemName());
          viewHolder.ItemPrice.setText(MainpageCardModel.getItemPrice());
          if(MainpageCardModel.getItemImage() == null){
              viewHolder.CardviewImageView.setImageDrawable(ContextCompat.getDrawable(mcontext,
                      R.drawable.ic_cake_dark));
          }
          else {
              Glide.with(mcontext)
                      .load(MainpageCardModel.getItemImage())
                      .into(viewHolder.CardviewImageView);
          }
      }
  
      public static class Recyclerviewholder extends RecyclerView.ViewHolder {
          public ImageView CardviewImageView;
          public TextView ItemName, ItemPrice;
  
          public Recyclerviewholder(View itemView) {
              super(itemView);
              CardviewImageView = (ImageView) itemView.findViewById(R.id.cakepic_cardview);
              ItemName = (TextView) itemView.findViewById(R.id.caketitle_cardview);
              ItemPrice = (TextView) itemView.findViewById(R.id.cakeprice_cardview);
  
          }
      }
  </code></pre>
  
  <p>My model class</p>
  
  <pre><code>public Class MainpageCardModel{
          public static String itemName;
          public static String itemImage;
          public static String itemPrice;
          public MainpageCardModel(){
  
          }
          public MainpageCardModel(String itemName, String itemImage, String itemPrice){
              this.itemImage=itemImage;
              this.itemName=itemName;
              this.itemPrice=itemPrice;
          }
  
          public static String getItemName() {
              return itemName;
          }
          public void setItemName(String itemName){
              this.itemName = itemName;
          }
  
         public static String getItemImage(){
             return itemImage;
         }
          public  void setItemImage(String itemImage){
              this.itemImage= itemImage;
  
          }
  
  
          public static String getItemPrice(){
              return itemPrice;
  
          }
  
          public void setItemPrice(String itemPrice) {
              this.itemPrice = itemPrice;
          }
      }
  </code></pre>
  
  <p>My Fragment</p>
  
  <pre><code>private static final String TAG = "FreshCreamFragment";
      public static final String MENU_CHILD = "FreshCream";
      private String Cakename, cakeprice, cakeurl;
      private RecyclerView mRecyclerView;
      private DatabaseReference mFirebaseDatabaseReference;
    private CardViewAdapter adapterl;
  private GridLayoutManager gridLayoutManager;
      public List&lt;MainpageCardModel&gt; cakeslist;
      ProgressBar mprogressbar;
      MainpageCardModel mainpageCardModel;
  
  
  
      @Override
      public void onCreate(@Nullable Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
  cakeslist= new ArrayList&lt;&gt;();
          adapterl = new CardViewAdapter(mFirebaseDatabaseReference.child(MENU_CHILD));
          mFirebaseDatabaseReference = FirebaseDatabase.getInstance().getReference().child("menu");
  
  
  mFirebaseDatabaseReference.child(MENU_CHILD).addValueEventListener(new ValueEventListener() {
      @Override
      public void onDataChange(DataSnapshot dataSnapshot) {
          Map&lt;String,String&gt; cakedetails = (Map)dataSnapshot.getValue();
          Cakename= cakedetails.get("Item_name");
          cakeprice = cakedetails.get("Item_price");
          cakeurl = cakedetails.get("url");
  
           mainpageCardModel = new MainpageCardModel(Cakename,cakeurl,cakeprice);
          cakeslist.add(mainpageCardModel);
  
          adapterl.notifyDataSetChanged();
  mprogressbar.setVisibility(ProgressBar.INVISIBLE);
      }
  
      @Override
      public void onCancelled(DatabaseError databaseError) {
  
      }
  });
  
  
          };
  
     @Nullable
      @Override
      public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
          View rootview = inflater.inflate(R.layout.fresh_cream_fragment, container, false);
          mprogressbar = (ProgressBar) rootview.findViewById(R.id.progressBar3);
          mRecyclerView = (RecyclerView) rootview.findViewById(R.id.freshcream_recyclerview);
  gridLayoutManager = new GridLayoutManager(getContext(),2);
  mRecyclerView.setLayoutManager(gridLayoutManager);
          mRecyclerView.setAdapter(adapterl);
  
  
          return rootview;
  
  
      }
  
  
  }
  </code></pre>
  
  <p>MYdb
  <a href="https://i.stack.imgur.com/5splL.png" rel="nofollow noreferrer">mydbscreenshot</a></p>