title: RecyclerView: No adapter attached; skipping layout Surface is not valid
body: <p>I am fetching images from firebase into RecyclerView in Main2Activity . The follow error is happening</p>
  <pre><code>10-19 14:23:33.774 26270-26270/? E/waliwallpapaer: Unknown bits set in runtime_flags: 0x8000
  10-19 14:23:38.993 26270-26270/com.ashishapps.android.diwaliwallpapaers E/RecyclerView: No adapter attached; skipping layout
  10-19 14:25:39.582 26270-26270/com.ashishapps.android.diwaliwallpapaers E/ViewRootImpl@e3bf762[Main2Activity]: Surface is not valid.
  </code></pre>
  <p>I cant find what am doing wrong i have attatched the adapter still error is showing</p>
  <p>the code given below is in the onCreat Method of the Main2Activity`</p>
  <pre><code> databaseReference.addValueEventListener(new ValueEventListener() {
          @Override
          public void onDataChange(DataSnapshot dataSnapshot) {
          /////getting data out of node]
              for(DataSnapshot postSnapshot:dataSnapshot.getChildren()){
                  CardActivity item= postSnapshot.getValue(CardActivity.class);
                  cardActivityList.add(item);
                  Log.d(&quot;MeraLog&quot;, &quot;Value is: &quot; + item.toString());
              }
              ///
              adapter= new ImageAdapter(Main2Activity.this,cardActivityList);
              recyclerView.setAdapter(adapter);
          }
  
          @Override
          public void onCancelled(DatabaseError databaseError) {
              Toast.makeText(Main2Activity.this,databaseError.getMessage(),Toast.LENGTH_SHORT).show();
          }
      });
  </code></pre>