0

Within MainActivity.java I wrote a setOnClickListener method. Inside onClick, there is the following code:

@Override
public void onClick(View view) {
    DialogShowNote dialog = new DialogShowNote();
    dialog.sendNoteSelected();
    dialog.show(getFragmentManager(), "123");
}

DialogShowNote is a class that extends DialogFramgment and is contained in the smae Java package. I get the error

"Cannot resolve symbol "DialogShowNote"

Does anyone have a clue?

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96
Jan
  • 13
  • 3

2 Answers2

1

Try the following:

  1. Check that the class name and the file name are the same, look for typos.
  2. Check imported classes, ensure it is being imported correctly into your class.
  3. Check the file paths, ensure the paths are correct or if the package is different.
  4. Do a reclean/'gradle sync' and recompile to ensure there is no garbage.
  5. Check class access, ensure it is public.
  6. Check the constructor, ensure this exists and is public.

Good luck.

wseme
  • 805
  • 6
  • 14
1

Delete the .idea file and restart the IntelliJ/Android Studio.

nairsk
  • 71
  • 1
  • 3