NullPointerException while calling setText method in fragment

Issue I tried to set text in TextView in fragment from main class but got NullPointerException. I’ve initialized TextView in onCreateView(…) but it did not help. Here is my fragment: <?xml version="1.0" encoding="utf-8"?> <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" >

Continue reading