title: findViewById() doesn't find RecyclerView in a second activity
body: <p>I have a MainActivity with a RecyclerView (trackingsRecycler) and an Adapter to list a CardView and it works fine.</p>
  
  <p>When I click on some cardview, the app calls (with Intent) another activity (DetailsActivity) and it should list another RecyclerView (detailsRecycler).</p>
  
  <p>but in DetailsActivity the code</p>
  
  <pre><code>RecyclerView detailsRecyclerView = findViewById(R.id.recycler_details_view);
  </code></pre>
  
  <p>doesn't work</p>
  
  <p>the findViewById returns 'null'</p>
  
  <p>Can anyone help me?</p>
  
  <p>MainActivity.java</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  public static final String TRACKING = "com.example.cooltracker.MESSAGE";
  private RecyclerView recyclerView;
  private TrackingsAdapter adapter;
  private List&lt;Tracking&gt; trackingList;
  private ProgressDialog pDialog;
  private String webserviceURL;
  private TextView total;
  
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      webserviceURL = "http://myWebServiceUrl.com/params";
  
      ---&gt; recyclerView = findViewById(R.id.recycler_main_view); &lt;--- Ok!!
  
      trackingList = new ArrayList&lt;&gt;();
      adapter      = new TrackingsAdapter(this, trackingList);
  
      total = findViewById(R.id.tvTotal);
  
      RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 1);
      recyclerView.setLayoutManager(mLayoutManager);
      recyclerView.addItemDecoration(new GridSpacingItemDecoration(1, dpToPx(5), true));
      recyclerView.setItemAnimator(new DefaultItemAnimator());
      recyclerView.setAdapter(adapter);
  
      ... 
  </code></pre>
  
  <h1>On TrackingsAdapter.java I put the clickListener to call the next screen</h1>
  
  <pre><code>public class TrackingsAdapter extends RecyclerView.Adapter&lt;TrackingsAdapter.MyViewHolder&gt; {
  
        private Context mContext;
        private List&lt;Tracking&gt; trackingList;
  
        public class MyViewHolder extends RecyclerView.ViewHolder {...}
  
        @override
        public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 
               View itemView = LayoutInflater.from(parent.getContext()).inflate(R.layout.tracking_card, parente, attachToRoot:false);
               final MyViewHolder mViewHolder = new MyViewHolder(itemView);
  
               return new MyViewHolder(itemView);
         }
  
         @Override
         public void onBindViewHolder(final MyViewHolder...){
               ...
               ...
               ...
  
               //Here I set the click listener
               holder.card.setOnClickListener(new View.OnClickListener() {
  
               @Override
               public void onClick(View view) {
                      getDetails(tracking.getTrack());
               }
         });
  
         private void getDetails(String tracking){
  
                 //Call next screen DetailsActivity...
                 Intent intent = new Intent(mContext, DetailsActivity.class);
  
                 intent.putExtra(TRACKING, tracking);
  
                 mContext.startActivity(intent);
         }
  </code></pre>
  
  <p>So far it's working well!!! The code calls the next screen...</p>
  
  <p>But...</p>
  
  <h1>On the next screen should also have a list view (RecyclerView)</h1>
  
  <p>DetailsActivity.java</p>
  
  <pre><code>public class DetailsActivity extends AppCompatActivity {
  
      private RecyclerView recyclerView;
      private DetailsAdapter adapter;
      private List&lt;Tracking&gt; detailList;
      private ProgressDialog pDialog;
      private String webserviceURL;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_details);
  
            //get intent
            Intent intent = getIntent();
  
            String tracking  = intent.getStringExtra(MainActivity.TRACKING);
  
            //set string in layout
            TextView tvHeaderLine1 = findViewById(R.id.tvHeaderLine1);
            tvHeaderLine1.setText(tracking);
  
            webserviceURL = "http://werService.com/otherAction";
  
  
            //THIS PART IS NOT WORKING ///
            ----&gt; recyclerView = findViewById(R.id.recycler_detail_view); &lt;----
            System.out.println(recyclerView); // It's always returning NULL
  
            detailList   = new ArrayList&lt;&gt;();
            adapter      = new DetailsAdapter(this, detailList);
  
            RecyclerView.LayoutManager mLayoutManager = new GridLayoutManager(this, 1);
            //recyclerView.setLayoutManager(mLayoutManager);
            //recyclerView.setAdapter(adapter);
  
            // prepare the loading Dialog
            pDialog = new ProgressDialog(this);
            pDialog.setMessage("Message");
            pDialog.setCancelable(false);
  
  
            ...
            ...
  
      }
  
  }
  </code></pre>