title: addChildEventListener is showing error while addValueEventListener is giving the value of datasnapshot. why?
body: <p>database structure is</p>
  
  <p><img src="https://i.stack.imgur.com/30Sww.png" alt="Databse Strucutre"></p>
  
  <p>this listner is providing value to model class</p>
  
  <pre><code> ref.child(stateName).child(cityName).child("business").child(user).child("counter").addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
  
  
              ShopCategoryModel  Smodel =  dataSnapshot.getValue( ShopCategoryModel.class);
  
  
  
  
              servicetype = Smodel.getServicetype();
              int orderleft = Smodel.getOrderleft();
              int uploadsleft = Smodel.getUploadsleft();
              int referralpionts = Smodel.getReferralpionts();
              renewaldate = Smodel.getRenewaldate();
              int vistors = Smodel.getVisitors();
              int ratings = Smodel.getRatings();
  
              ac_TotalVisitors.setText(""+vistors);
              ac_ratingBar.setRating(Float.parseFloat(String.valueOf(ratings)));
              ac_Shope_ratings.setText(""+ratings);
  
              ac_orderleft.setText(""+orderleft);
              ac_Uploadsleft.setText(""+uploadsleft);
              ac_Referralpoints.setText(""+referralpionts);
              ac_renewdate.setText(renewaldate);
  
  
  
  
  
  
  
  
              }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  </code></pre>
  
  <p>while applying addChildEventListener  is showing error</p>
  
  <pre><code> ref.child(stateName).child(cityName).child("business").child(user).child("counter").addChildEventListener(new ChildEventListener() {
          @Override
          public void onChildAdded(DataSnapshot dataSnapshot, String s) {
  
  
              ShopCategoryModel  Smodel =  dataSnapshot.getValue( ShopCategoryModel.class);
  
  
  
              servicetype = Smodel.getServicetype();
              int orderleft = Smodel.getOrderleft();
              int uploadsleft = Smodel.getUploadsleft();
              int referralpionts = Smodel.getReferralpionts();
              renewaldate = Smodel.getRenewaldate();
  
              int vistors = Smodel.getVisitors();
              int ratings = Smodel.getRatings();
  
              ac_TotalVisitors.setText(""+vistors);
              ac_ratingBar.setRating(Float.parseFloat(String.valueOf(ratings)));
              ac_Shope_ratings.setText(""+ratings);
  
              ac_orderleft.setText(""+orderleft);
              ac_Uploadsleft.setText(""+uploadsleft);
              ac_Referralpoints.setText(""+referralpionts);
              ac_renewdate.setText(renewaldate);
  
  
          }
  
          @Override
          public void onChildChanged(DataSnapshot dataSnapshot, String s) {
  
          }
  
          @Override
          public void onChildRemoved(DataSnapshot dataSnapshot) {
  
          }
  
          @Override
          public void onChildMoved(DataSnapshot dataSnapshot, String s) {
  
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
  
          }
      });
  </code></pre>
  
  <p>after this m getting this error</p>
  
  <pre><code> Process: mahendergarh.bhupendra.shaharseller, PID: 18837
                                                                                   com.google.firebase.database.DatabaseException: Can't convert object of type java.lang.Long to type mahendergarh.bhupendra.shaharseller.model.ShopCategoryModel
                                                                                       at com.google.android.gms.internal.adw.zzb(Unknown Source)
                                                                                       at com.google.android.gms.internal.adw.zza(Unknown Source)
                                                                                       at com.google.firebase.database.DataSnapshot.getValue(Unknown Source)
                                                                                       at mahendergarh.bhupendra.shaharseller.Sign_in.Account$3.onChildAdded(Account.java:255)
                                                                                       at com.google.android.gms.internal.uv.zza(Unknown Source)
                                                                                       at com.google.android.gms.internal.aaf.zzIo(Unknown Source)
                                                                                       at com.google.android.gms.internal.aal.run(Unknown Source)
                                                                                       at android.os.Handler.handleCallback(Handler.java:746)
                                                                                       at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                                       at android.os.Looper.loop(Looper.java:148)
                                                                                       at android.app.ActivityThread.main(ActivityThread.java:5443)
                                                                                       at java.lang.reflect.Method.invoke(Native Method)
                                                                                       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
                                                                                       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
  </code></pre>
  
  <p>m using each listeners at different time.
  please tell me  the reason why this is happening why m getting model class error in addChildEventListener. thanq in advance!!!!</p>