Skip to content Skip to sidebar Skip to footer

Strange Nullpointerexception When Trying To Retrieve Linearlayout

This is a bit of a shot in the dark, but perhaps I'm making an obvious mistake; I have a LinearLayout defined in my main.xml, with an id '@+id/imageListContainer'. There is nothing

Solution 1:

This was the answer from the comments of the question:

Do you have an inner class in your activity? I read the exception trace carefully: first com.company.PictureListPictureListActivity.onCreate then com.company.PictureListView.PictureListActivity.updateMainActivityScreen --> seems to me findViewById is called in a different object. Try moving the findViewByID into the onCreate and check if it works there.

It seems there was an inner class at some point of development, which was later removed. Somehow project files were not updated appropriately. Cleaning the project, refreshing file system contents, and re-building the project should make things right again.

Post a Comment for "Strange Nullpointerexception When Trying To Retrieve Linearlayout"