title: data doesn't show up on recyclerview - got error No layout manager attached; skipping layout
body: <p>i tried to retrieving data from Firebase Realtime Database to Recycler-view. i already create Modul class called Ph.java and adapter called PhAdapter.java. but, i am so confused to call the adapter on MainActivity.java. here's my code :)</p>
  
  <p>Ph.Class</p>
  
  <pre><code>public class Ph {
  
      public String date;
      public String nilai;
      public String time;
  
      public Ph(){
      }
  
      public String getDate() {
          return date;
      }
  
      public void setDate(String date) {
          this.date = date;
      }
  
      public String getNilai() {
          return nilai;
      }
  
      public void setNilai(String nilai) {
          this.nilai = nilai;
      }
  
      public String getTime() {
          return time;
      }
  
      public void setTime(String time) {
          this.time = time;
      }
  }
  </code></pre>
  
  <p>and here's my PhAdapter.java</p>
  
  <pre><code>public class PhAdapter extends RecyclerView.Adapter&lt;PhAdapter.PhViewHolder&gt; {
  
      private List&lt;Ph&gt; dataph;
      private Context context;
  
      public PhAdapter(List&lt;Ph&gt; dataph, Context context) {
          this.dataph = dataph;
          this.context = context;
      }
  
      @Override
      public PhViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
          //View view = LayoutInflater.from(parent.getContext()).inflate(rowLayout, parent, false);
          View view = LayoutInflater.from(context).inflate(R.layout.view_ph_list,parent,false);
          PhViewHolder phViewHolder = new PhViewHolder(view);
          return new PhViewHolder(view);
      }
  
      @Override
      public void onBindViewHolder(final PhViewHolder holder, final int position) {
          Ph mylist = dataph.get(position);
          holder.tvNilai.setText(mylist.getNilai());
          holder.tvTime.setText(mylist.getTime());
          holder.tvDate.setText(mylist.getDate());
      }
  
      @Override
      public int getItemCount() {
          int arr = 0;
          try{
              if(dataph.size()==0){
                  arr = 0;
              }
              else{
                  arr=dataph.size();
              }
          }catch (Exception e){
          }
          return arr;
      }
  
      public static class PhViewHolder extends RecyclerView.ViewHolder {
  
          private TextView tvNilai, tvDate, tvTime;
  
          public PhViewHolder(View itemview) {
              super(itemview);
              tvNilai = (TextView) itemview.findViewById(R.id.tv_ph);
              tvTime = (TextView) itemview.findViewById(R.id.tv_time);
              tvDate = (TextView) itemview.findViewById(R.id.tv_date);
          }
      }
  }
  </code></pre>
  
  <p>and my MainActivity class</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      FirebaseDatabase database;
      DatabaseReference myRef;
      List&lt;Ph&gt; dataph;
      RecyclerView recyclerView;
      Button cekdata;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          cekdata = (Button) findViewById(R.id.btn_cekdata);
          recyclerView = (RecyclerView) findViewById(R.id.recycler_view1);
          database = FirebaseDatabase.getInstance();
          myRef = database.getReference("ph");
  
          myRef.addValueEventListener(new ValueEventListener() {
              @Override
              public void onDataChange(DataSnapshot dataSnapshot) {
                  dataph = new ArrayList&lt;Ph&gt;();
                  for (DataSnapshot dataSnapshot1 :dataSnapshot.getChildren()){
                      Ph value = dataSnapshot1.getValue(Ph.class);
                      Ph phModel = new Ph();
                      String tvNilai = value.getNilai();
                      String tvDate = value.getDate();
                      String tvTime = value.getTime();
                      phModel.setNilai(tvNilai);
                      phModel.setDate(tvDate);
                      phModel.setTime(tvTime);
                      dataph.add(phModel);
                  }
              }
  
              @Override
              public void onCancelled(DatabaseError databaseError) {
                  //Failed to read value
                  Log.w("Hello", "Failed to read Ph.", databaseError.toException());
  
              }
          });
  
          cekdata.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View view) {
                  PhAdapter phAdapter = new PhAdapter(dataph,MainActivity.this);
                  RecyclerView.LayoutManager recyce = new LinearLayoutManager(MainActivity.this);
                  recyclerView.setLayoutManager(recyce);
                  recyclerView.setAdapter(phAdapter);
              }
          });
      }
  
  }
  </code></pre>
  
  <p>when i click the button, data doesn't show up on recyclerview and i got the error, RecyclerView: No layout manager attached; skipping layout.</p>