Sunday 19 February 2012

Android: null pointer exception after changing view id in xml

Sometimes after you modify view id in layout xml files, you get null pointer exception in seemingly irrelevant code due to findViewById returns null when finding irrelevant views.

This is due to modifying view id messed up the view id definitions of all views. A simple solution is to clean up your project and rebuild it (usually it should be auto rebuilt after cleaning up).

No comments:

Post a Comment