recyclerView.setAdapter does not accept ArrayAdapter
<p>I am trying to populate RecyclerView with simple String data but <code>recyclerView.setAdapter(adapter);</code> gives error. What's the problem?</p>

<p>I am new to recyclerview.</p>

<pre><code>RecyclerView recyclerView;
String []data = {"ankush", "kapoor"};

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    recyclerView = (RecyclerView) findViewById(R.id.myRecyclerView);
    ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, data);
    recyclerView.setLayoutManager(new LinearLayoutManager(this));
    recyclerView.setAdapter(adapter);
}
</code></pre>