title: How to open a details activity when an item is clicked in Firebase RecyclerView Cardview
body: <p>I want to Implement Onclick Item in recyclerView To open new activity I can pass data from one to another activity but in the code cannot figure out where to Implement on click onclicklistener if anyone is free to help me edit and give intent to Details.class<br>
  as I am getting data from firebase its first time to work on firebase any help would be appreciated.</p>
  
  <pre><code>import android.content.ActivityNotFoundException;
  import android.content.Context;
  import android.content.Intent;
  import android.net.Uri;
  import android.os.Bundle;
  import android.support.design.widget.FloatingActionButton;
  import android.support.design.widget.NavigationView;
  import android.support.v4.view.GravityCompat;
  import android.support.v4.widget.DrawerLayout;
  import android.support.v7.app.ActionBarDrawerToggle;
  import android.support.v7.app.AppCompatActivity;
  import android.support.v7.widget.RecyclerView;
  import android.support.v7.widget.StaggeredGridLayoutManager;
  import android.support.v7.widget.Toolbar;
  import android.view.Menu;
  import android.view.MenuItem;
  import android.view.View;
  import android.view.animation.Animation;
  import android.view.animation.ScaleAnimation;
  import android.widget.ImageView;
  import android.widget.TextView;
  
  import com.dekhou.provissionstore.model.Movie;
  import com.firebase.ui.database.FirebaseRecyclerAdapter;
  import com.google.firebase.database.DatabaseReference;
  import com.google.firebase.database.FirebaseDatabase;
  import com.squareup.picasso.Picasso;
  
  public class MainActivity extends AppCompatActivity
          implements NavigationView.OnNavigationItemSelectedListener {
  
  
      private FloatingActionButton fab;
  
  
      ScaleAnimation shrinkAnim;
      private RecyclerView mRecyclerView;
      private StaggeredGridLayoutManager mLayoutManager;
      private TextView tvNoMovies,tvNoMovies1;
      private Context context;
  
      //Getting reference to Firebase Database
      FirebaseDatabase database = FirebaseDatabase.getInstance();
      DatabaseReference mDatabaseReference = database.getReference();
  
      private static final String userId = "01";
  
  
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
          setSupportActionBar(toolbar);
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          ActionBarDrawerToggle toggle = new ActionBarDrawerToggle(
                  this, drawer, toolbar, R.string.navigation_drawer_open, R.string.navigation_drawer_close);
          drawer.setDrawerListener(toggle);
          toggle.syncState();
          NavigationView navigationView = (NavigationView) findViewById(R.id.nav_view);
          navigationView.setNavigationItemSelectedListener(this);
          //Initializing our Recyclerview
          mRecyclerView = (RecyclerView) findViewById(R.id.my_recycler_view);
          tvNoMovies = (TextView) findViewById(R.id.tv_no_movies);
          //tvNoMovies1 = (TextView) findViewById(R.id.addresstxt);
  
          //scale animation to shrink floating actionbar
          shrinkAnim = new ScaleAnimation(1.15f, 0f, 1.15f, 0f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
  
          if (mRecyclerView != null) {
              //to enable optimization of recyclerview
              mRecyclerView.setHasFixedSize(true);
          }
          //using staggered grid pattern in recyclerview
          mLayoutManager = new StaggeredGridLayoutManager(1, StaggeredGridLayoutManager.VERTICAL);
          mRecyclerView.setLayoutManager(mLayoutManager);
  
          //Say Hello to our new FirebaseUI android Element, i.e., FirebaseRecyclerAdapter
          FirebaseRecyclerAdapter&lt;Movie,MovieViewHolder&gt; adapter = new FirebaseRecyclerAdapter&lt;Movie, MovieViewHolder&gt;(
                  Movie.class,
                  R.layout.movie_board_item,
                  MovieViewHolder.class,
                  //referencing the node where we want the database to store the data from our Object
                  mDatabaseReference.child("users").child(userId).child("shops").getRef()
          ) {
              @Override
              protected void populateViewHolder(MovieViewHolder viewHolder, final Movie model, final int position) {
                  if(tvNoMovies.getVisibility()== View.VISIBLE){
                      tvNoMovies.setVisibility(View.GONE);
                  }
                  viewHolder.tvMovieName.setText(model.getMovieName());
                  viewHolder.address.setText(model.getAddress());
                  viewHolder.phone.setText(model.getPhone());
                  viewHolder.lit.setText(model.getLit());
                  viewHolder.lon.setText(model.getLon());
                  Picasso.with(MainActivity.this).load(model.getMoviePoster()).into(viewHolder.ivMoviePoster);
  
  
  // all your stuff
  
              }
          };
  
          mRecyclerView.setAdapter(adapter);
  
  
          fab = (FloatingActionButton) findViewById(R.id.fab);
          fab.setOnClickListener(new View.OnClickListener() {
              public void onClick(View v) {
                  getSupportFragmentManager().beginTransaction()
                          .replace(R.id.frame_container, new AddMovieFragment())
                          .addToBackStack(null)
                          .commit();
                  //animation being used to make floating actionbar disappear
                  shrinkAnim.setDuration(400);
                  fab.setAnimation(shrinkAnim);
                  shrinkAnim.start();
                  shrinkAnim.setAnimationListener(new Animation.AnimationListener() {
                      @Override
                      public void onAnimationStart(Animation animation) {
  
                      }
  
                      @Override
                      public void onAnimationEnd(Animation animation) {
                          //changing floating actionbar visibility to gone on animation end
                          fab.setVisibility(View.GONE);
                      }
  
                      @Override
                      public void onAnimationRepeat(Animation animation) {
  
  
                      }
                  });
  
              }
          });
  
      }
  
  
      @Override
      public void onBackPressed() {
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          if (drawer.isDrawerOpen(GravityCompat.START)) {
              drawer.closeDrawer(GravityCompat.START);
          } else {
              super.onBackPressed();
          }
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.main, menu);
  
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          // Handle action bar item clicks here. The action bar will
          // automatically handle clicks on the Home/Up button, so long
          // as you specify a parent activity in AndroidManifest.xml.
          int id = item.getItemId();
  
          //noinspection SimplifiableIfStatement
          if (id == R.id.menu_map) {
  
              Intent intent = new Intent(this, MapsActivity.class);
              this.startActivity(intent);
          }
  
          return super.onOptionsItemSelected(item);
      }
  
      @SuppressWarnings("StatementWithEmptyBody")
      @Override
      public boolean onNavigationItemSelected(MenuItem item) {
          // Handle navigation view item clicks here.
          int id = item.getItemId();
  
          if (id == R.id.nav_slideshow) {
              Intent cinemaIntent = new Intent(this, MapsActivity.class);
              startActivity(cinemaIntent);
          } else if (id == R.id.nav_manage) {
              Intent cinemaIntent = new Intent(this, Get_Data.class);
              startActivity(cinemaIntent);
          } else if (id == R.id.nav_share) {
              try {
                  //try to open page in facebook native app.
                  String uri = "fb://page/" + "293069792077";    //Cutsom URL
                  Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
                  startActivity(intent);
              }catch (ActivityNotFoundException ex){
                  //facebook native app isn't available, use browser.
                  String uri = "http://touch.facebook.com/pages/x/" + "293069792077";  //Normal URL
                  Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(uri));
                  startActivity(i);
              }
          } else if (id == R.id.nav_send) {
  
              Intent cinemaIntent = new Intent(this, About_Us.class);
              startActivity(cinemaIntent);
  
          }
  
          DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);
          drawer.closeDrawer(GravityCompat.START);
          return true;
      }
  
      //ViewHolder for our Firebase UI
      public static class MovieViewHolder extends RecyclerView.ViewHolder{
  
          TextView tvMovieName,address,phone,lit,lon;
  
          ImageView ivMoviePoster;
  
  
          public MovieViewHolder(View v) {
              super(v);
              tvMovieName = (TextView) v.findViewById(R.id.tv_name);
              address = (TextView) v.findViewById(R.id.address1);
              phone = (TextView) v.findViewById(R.id.tv_phone);
              lit = (TextView) v.findViewById(R.id.geo);
              lon = (TextView) v.findViewById(R.id.geo2);
  
  
              ivMoviePoster = (ImageView) v.findViewById(R.id.iv_movie_poster);
  
  
  
  
          }
  
  
  
  
  
      }
  
  
  }
  </code></pre>