Ah, I am leaving. I encountered this problem during development today. Everything is okay. How can I get a null pointer exception? The logic is absolutely no problem. I use simplecursoradapter. First, I cannot obtain the data of holder given by newview in BindView. debug found that the value assigned to the holder object in newview is null, I found that findviewbyid () is null. There is no reason for this. I found the information online and cried.
Generally, there are three situations that cause this result. Let's briefly describe:
First, the layout file is not loaded, that is, findviewbyid () before the layout is set. This is definitely not available. This is the problem of chicken and eggs. Needless to say;
Second, the view should be a tree-like organization. It cannot be found from the current contentview. You must set contentview to include the contentview to be found;
Third, it is caused by eclipse. Once the project is clean (Project menu-> clean sub-menu), it will be OK.
Second, I fell into the third situation, and I had to struggle. It's okay to clean it. Are you two, bro ?!