title: java.lang.InstantiationException: class com.e has no zero argument constructor
body: <p>I am getting this error </p>
  
  <pre><code>java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.e.www.i/com.e.www.i.Search}: java.lang.InstantiationException: class com.e.www.i.Search has no zero argument constructor
  </code></pre>
  
  <p>This is the below class :</p>
  
  <pre><code>public class Search extends Activity {
      private RecyclerView mRecyclerView;
      private RecyclerView.Adapter mAdapter;
  
      private RecyclerView mRecyclerView1;
      private RecyclerView.Adapter mAdapter1;
      Context mContext;
  
      public Search(Context context) {
  
          mContext = context; // I guess the error is here, but I need to define context for below MyAdapter
      }
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_recycler_view);
  
          mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
          mRecyclerView.setHasFixedSize(true);
          mRecyclerView.setLayoutManager(
                  new LinearLayoutManager(this,LinearLayoutManager.HORIZONTAL, false));
          mAdapter = new MyAdapter(getDataSet(),mContext);
          mRecyclerView.setAdapter(mAdapter);
  
        }
  
  private ArrayList&lt;String&gt; getDataSet() {
          ArrayList results = new ArrayList&lt;DataObject&gt;();
          for (int index = 0; index &lt; 5; index++) {
              String obj = new String("User " + index);
              results.add(index, obj);
          }
          return results;
      }
  </code></pre>