Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

during execution master detail flow i get 2 errors 1-Error:(77, 24) error: cannot find symbol class ItemListActivity

public static class SimpleItemRecyclerViewAdapter
        extends RecyclerView.Adapter<SimpleItemRecyclerViewAdapter.ViewHolder> {

    private final  ItemListActivity mParentActivity;
    private final List<DummyContent.DummyItem> mValues;
    private final boolean mTwoPane;
    private final View.OnClickListener mOnClickListener = new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            DummyContent.DummyItem item = (DummyContent.DummyItem) view.getTag();
            if (mTwoPane) {
                Bundle arguments = new Bundle();
                arguments.putString(WebpageDetailFragment.ARG_ITEM_ID, item.id);
                WebpageDetailFragment fragment = new WebpageDetailFragment();
                fragment.setArguments(arguments);

                mParentActivity.getSupportFragmentManager().beginTransaction()
                        .replace(R.id.webpage_detail_container, fragment)
                        .commit();
like image 385
Shahrukh Sanjrani Avatar asked Mar 03 '18 04:03

Shahrukh Sanjrani


2 Answers

This happens when you change the default item names during the wizard of creating the activity. just rename the ItemListActivity to the name of your Activity . ( the name of the file that has that code error). use refactor rename to change it everywhere it's mentioned.

like image 83
Bahha Avatar answered Nov 09 '22 02:11

Bahha


If the ItemListActivity (or whatever you ended up calling it) extends from Activity and not AppCompatActivity then try changing the line

mParentActivity.getSupportFragmentManager().beginTransaction()

to

mParentActivity.getFragmentManager().beginTransaction()

like image 39
Cameron A Avatar answered Nov 09 '22 00:11

Cameron A