The message is even clearer than NullPointerException messages given by Java: It clearly says that rLayout is null.

And your code assigns the result of the findViewById method to rLayout, so clearly that result is null. So you should look into why app.findViewById() is returning null. Without knowing anything about your application I would guess that the method is looking up views based on an ID, and the ID you passed to the method doesn't have any corresponding view.

Eric Sweeten

Greenhorn

Posts: 21

posted 2 years ago

The R.id.relativeLayout is referring to the only RelativeLayout in the xml file. Here is my xml file: