Same Error was coming with my code in Activity but not in Fragment. Showing constructor error for different line like new Intent( From.this, To.class) and new ArrayList<> etc.
Fixed using closing Android Studio and moving the repository to other location and opening the the project once again. Fixed the problem.
Seems like Android Studio building problem.