Skip to content Skip to sidebar Skip to footer

Nullpointerexception In Cursoradapter's Bindview() Method

I'm getting the following errors in my app, and I think it has to do with the way I did the layout files, or used them in my code. 05-31 13:39:59.283: E/AndroidRuntime(332): Uncaug

Solution 1:

v is null and tv is also null...so null pointer exeption...due to wrong xml refrence of layout file row i mean item.you should use R.layout.achievements_item.xml while inflating item, in newView method...

 View v = inflater.inflate(R.layout.achievements_item, parent, false);
                                    ^^^^^^^^^^^^^^^^^ 

        @Override
        public View newView(Context context, Cursor cursor, ViewGroup parent) {
            LayoutInflater inflater = LayoutInflater.from(context);
            View v = inflater.inflate(R.layout.achievements_item, parent, false);
            return v;
        }

Post a Comment for "Nullpointerexception In Cursoradapter's Bindview() Method"