I was working on my app and everything was normal until I tried to display image in java.
I ran the app once and it ran normally, the picture was displayed. After th
Make sure your variables are in scope for the method that is referencing it. For example I had defined a textview locally in a method in the class and was referencing it in another method.
I moved the textview definition outside the method right below the class definition so the other method could access the definition, which resolved the problem.
Open project in android studio click file and click Invalidate Caches/Restart