I’ve got problem with my simple apliccation.
I don’t want paste tons of code.
I’ve got class Zaladuj where i must load files using getResources().
loading_screen = BitmapFactory.decodeResource(Widok.getResources(),R.drawable.loading_screen);
On this line i’ve got error:
Cannot make a static reference to the non-static method getResources() from the type View.
I put all classes codes here: http://www.pcyra.pl/badpanda
It’s not a website, it’s just folder with my project. I create instance of View in MainActivity, The error shows in class Zaladuj on line 50.
getResources() is not a static method. You need an instance of the
View(orWidokin your case) to call it. Your best bet would be to add a parameter to yourZaladujclass that accepts aContextthen usegetResources()on that: