I have two pictures I would like to rotate as a background image on an android app in a fragment.
Right now one is statically in the .xml
as
android:background="@drawable/background"
I am trying to initialize the two photos in my Fragment.java
but I am getting null pointer errors.
private Drawable img1 =
ContextCompat.getDrawable(this.getContext(),R.drawable.background);
private Drawable img2 =
ContextCompat.getDrawable(this.getContext(),R.drawable.background2);
Does anyone have any suggestions why I am getting a null error here?
Thanks!