Yeah, that line has been set properly.
I googled a bit for that "findViewById returns null", and found stuff like
Quote:
|
Within findViewById(...) you can only refer to what you set as layout within OnCreate(...)
|
At any rate that "setContentView(R.layout.whatever)" seems to be important. Thing is, in onCreate, I set: setContentView(R.layout.
route_screen);
The image I'm trying to access, however, is in R.layout.
route_item.
This is because
route_screen is the layout of the overall screen, and
route_item is the layout of the objects that get listed inside it.
I mean I can't just replace the layout and make the whole screen look like one item, that's not the idea (and it doesn't work anyway, it makes it crash).
I tested it: findViewById can find all the objects in
route_screen, and returns null for all the objects in
route_item.
So how can I get around this, to make the findViewById find the right items while keeping the overall layout I want?