title: E/RecyclerView: No adapter attached; skipping layout (MainActivity to HomeFragment)
body: <p>How can i move these activity from MainActivity to HomeFragment?
  Can i move by create new class in Home fragment?</p>
  
  <p>I tried to move by create new class <code>HomeFragment2</code> as below</p>
  
  <pre><code>package com.domachita.jsdict.ui.home;
  
  import android.os.Bundle;
  import android.support.v7.widget.LinearLayoutManager;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.RecyclerView;
  import android.text.Editable;
  import android.text.TextWatcher;
  import android.view.LayoutInflater;
  import android.view.View;
  import android.view.ViewGroup;
  import android.widget.TextView;
  import android.support.annotation.Nullable;
  import android.support.annotation.NonNull;
  import android.support.v4.app.Fragment;
  import android.arch.lifecycle.Observer;
  import android.arch.lifecycle.ViewModelProviders;
  
  import com.domachita.jsdict.Adapter.SearchAdapter;
  import com.domachita.jsdict.Database.Database;
  import com.domachita.jsdict.R;
  import com.mancj.materialsearchbar.MaterialSearchBar;
  
  import java.util.ArrayList;
  import java.util.List;
  
  public class HomeFragment extends Fragment{
  
      private HomeViewModel homeViewModel;
  
      @Override
      public View onCreateView(LayoutInflater inflater,
                               ViewGroup container, Bundle savedInstanceState) {
          homeViewModel =
                  ViewModelProviders.of(this).get(HomeViewModel.class);
          View root = inflater.inflate(R.layout.fragment_home, container, false);
          final TextView textView = root.findViewById(R.id.text_home);
          homeViewModel.getText().observe(this, new Observer&lt;String&gt;() {
              @Override
              public void onChanged(@Nullable String s) {
                  textView.setText(s);
              }
          });
          return root;
      }
  }
  
  class HomeFragment2 extends AppCompatActivity {
  
  
      RecyclerView recyclerView;
      RecyclerView.LayoutManager layoutManager;
      SearchAdapter adapter;
  
      MaterialSearchBar materialSearchBar;
      List&lt;String&gt; suggestList = new ArrayList&lt;&gt;();
  
      Database database;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          //init view
          recyclerView = (RecyclerView)findViewById(R.id.recycler_search);
          layoutManager = new LinearLayoutManager(this);
          recyclerView.setLayoutManager(layoutManager);
          recyclerView.setHasFixedSize(true);
  
          materialSearchBar = (MaterialSearchBar)findViewById(R.id.search_bar);
  
          //init DB
          database = new Database(this);
  
          //Setup search bar
          materialSearchBar.setHint("検索したい語句を入力");
  
          materialSearchBar.addTextChangeListener(new TextWatcher() {
              @Override
              public void beforeTextChanged(CharSequence s, int start, int count, int after) {
  
              }
  
              @Override
              public void onTextChanged(CharSequence s, int start, int before, int count) {
  
                  List&lt;String&gt; suggest = new ArrayList&lt;&gt;();
                  for (String search:suggestList)
                  {
                      if (search.toLowerCase().contains(materialSearchBar.getText().toLowerCase()))
                          suggest.add(search);
                  }
                  materialSearchBar.setLastSuggestions(suggest);
  
              }
  
              @Override
              public void afterTextChanged(Editable s) {
  
              }
          });
          materialSearchBar.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {
              @Override
              public void onSearchStateChanged(boolean enabled) {
                  if (enabled)
                      recyclerView.setAdapter(adapter);
              }
  
              @Override
              public void onSearchConfirmed(CharSequence text) {
                  startSearch(text.toString());
              }
  
              @Override
              public void onButtonClicked(int buttonCode) {
  
              }
          });
  
  
          //Init Adapter default set all result
          adapter = new SearchAdapter(this,database.getDicts());
          recyclerView.setAdapter(adapter);
  
      }
  
      private void startSearch(String text) {
  
          adapter = new SearchAdapter(this,database.getDictByJapanese(text));
          recyclerView.setAdapter(adapter);
      }
  
  
  }
  </code></pre>
  
  <p>List doesn't appear and I have this error</p>
  
  <pre><code>E/RecyclerView: No adapter attached; skipping layout
  </code></pre>
  
  <p>I have modified a lot but unable to solve this.</p>
  
  <p>Thanks in advance!</p>