title: call an activity from RecyclerView error
body: <p>I am trying to call an activity from <code>RecyclerView</code> with the help of <strong><code>onitem click listner</code></strong> attached to <code>onBindViewHolder</code>. 
  when i try to start the activity it shows <strong><code>null pointer exception</code></strong> and an error occurs. </p>
  
  <p>From <code>main activity</code> i am passing <code>dataset</code> and <code>context</code> and with the help of that context i am trying to start an activity </p>
  
  <p>follwing is my code</p>
  
  <pre><code>public class mycard extends RecyclerView.Adapter&lt;mycard.ViewHolder&gt; {
  static ArrayList&lt;String&gt; mDataset = new ArrayList&lt;&gt;();
  static Integer[] image;
  static Context c;
  
  public mycard(ArrayList&lt;String&gt; main,Integer[] images,Context context) {
      mDataset = main;
      image=images;
      c=context;
  
  }
  public static class ViewHolder extends RecyclerView.ViewHolder  {
      // each data item is just a string in this case
      public TextView mTextView;
      public ImageView img;
  
      public ViewHolder(View v) {
          super(v);
  
          mTextView = (TextView) v.findViewById(R.id.info_text);
          img=(ImageView)v.findViewById(R.id.cardimage);
      }
  
  
  }
  
  
  @Override
  public mycard.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
      View v = LayoutInflater.from(viewGroup.getContext())
              .inflate(R.layout.cardview, viewGroup, false);
      // set the view's size, margins, paddings and layout parameters
  
      ViewHolder vh = new ViewHolder(v);
      return vh;
  }
  
  @Override
  public void onBindViewHolder(ViewHolder viewHolder,  final int i) {
      viewHolder.mTextView.setOnClickListener(new View.OnClickListener() {
          @Override
          public void onClick(View view) {
              int positon = i;
              Intent intent = new Intent(c,ContactUs.class);
              c.startActivity(intent);
          }
      });
      viewHolder.mTextView.setText(mDataset.get(i));
      viewHolder.img.setImageResource(image[i]);
  }
  
  @Override
  public int getItemCount() {
      return mDataset.size();
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Follwing ERROR I AM GETTING</p>
  
  <blockquote>
    <p>05-07 13:50:58.604    9767-9767/aptlegion.vivatoyata E/AndroidRuntime﹕
    FATAL EXCEPTION: main
        Process: aptlegion.vivatoyata, PID: 9767
        java.lang.NullPointerException
                at android.content.ComponentName.(ComponentName.java:77)
                at android.content.Intent.(Intent.java:3826)
                at aptlegion.vivatoyata.mycard$1.onClick(mycard.java:60)
                at android.view.View.performClick(View.java:4569)
                at android.view.View$PerformClick.run(View.java:18570)
                at android.os.Handler.handleCallback(Handler.java:743)
                at android.os.Handler.dispatchMessage(Handler.java:99)
                at android.os.Looper.loop(Looper.java:136)
                at android.app.ActivityThread.main(ActivityThread.java:5196)
                at java.lang.reflect.Method.invokeNative(Native Method)
                at java.lang.reflect.Method.invoke(Method.java:515)
                at    com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
                at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:602)
                at dalvik.system.NativeStart.main(Native Method)</p>
  </blockquote>
  
  <p>AND IN MAIN ACTIVTY </p>
  
  <pre><code> RecyclerView mRecyclerView = (RecyclerView)        findViewById(R.id.my_recycler_view);
      mRecyclerView.setHasFixedSize(true);
      mLayoutManager = new LinearLayoutManager(this);
      mRecyclerView.setLayoutManager(mLayoutManager);
      mAdapter = new mycard(main ,imageId,context);
      mRecyclerView.setAdapter(mAdapter);
  </code></pre>
  
  <p>Please help me with the problem</p>