title: Android Toggle Switch to make it on or off by data
body: <p>If the data I have pulled from the Firebase database is true, I want toggle switch to be on, and false to be off. How do I set the status of being on or off when I open the app? Product in the following <code>code.getstates() == enabled</code>, I wanted to enable if true, but it's not working right now.</p>
  
  <pre><code>   @Override
      public void onBindViewHolder(ProductViewHolder holder, int position) {
       DatabaseReference mDatabase = FirebaseDatabase.getInstance().getReference();
          final   DatabaseReference ref = mDatabase.child("0").child("states");
      holder.viewStatus.setChecked(product.getStates());
  
              if(product.getStates() == true) {
          holder.viewStatus.isChecked();
  
      }else{
  
      }
  }
  </code></pre>