Used Navigation Drawer Activity (created using the environment of Android Studio). Added RecyclerView with cards (CardView) to the main screen. I can not open a new frame by clicking on the card.

Library: import android.support.v7.app.AppCompatActivity;

fragment class code:

import android.app.Fragment; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; public class AdvertDetails extends Fragment { ... } 

Adapter code RecyclerViewAdapter:

 public void onBindViewHolder(final MyViewHolder holder, int position) { AdvertItem album = albumList.get(position); holder.title.setText(album.title); holder.count.setText(album.price + " рублей"); // loading album cover using Glide library Glide.with(mContext).load(album.thumbnail).into(holder.thumbnail); holder.cardView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Fragment fragment = null; fragment = new AdvertDetails(); FragmentManager manager = ((Activity) mContext).getFragmentManager(); manager.beginTransaction() .replace(R.id.container, fragment) .commit(); } }); } 

Java.lang.IllegalArgumentException error: No view found for id 0x7f080033 (programs: id / container) for fragment AdvertDetails {31fef6 # 1 id = 0x7f080033}

Closed due to the fact that off-topic participants pavlofff , post_zeew , andreymal , MSDN.WhiteKnight , Viktorov Jan 18 '18 at 5:19 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • "The question is caused by a problem that is no longer reproduced or typed . Although similar questions may be relevant on this site, solving this question is unlikely to help future visitors. You can usually avoid similar questions by writing and researching a minimum program to reproduce the problem before publishing the question. " - pavlofff, post_zeew, andreymal, MSDN.WhiteKnight, Viktorov
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Corrected the error. It turns out in the XML markup accidentally deleted android: id = "@ + id / container" - pl_roman

0