android - CodeLearn Twitter Tutorial nullpointer error on TweetAdapter.java -
I am currently doing codelearn Twitter tutorial but I am getting a zero point in my code below - someone please help Can I?
}
your convertView
It can be redundant, there is no guarantee that it will be non-null. If there is no old view to reuse, then it will be empty
Change
public view getView (see the status of int, seeviewview, ViewGroup parent) {Tweet t = tweetsList.get (terms); *** TextView Title = (TextView) ConvertviewFindvubid (RIDTTT); *** TextView Body = (TextView) ConvertviewFindViewID (RTDBBB); Title.setText (t.getTitle ()); Body.setText (t.getBody ()); Return inflater.inflate (R.layout.row_tweet, guardian, incorrect); }
see public getView (see the status of int, viewview, parent ViewGroup) {if (convertView == null) convertView = inflater.inflate ( R.layout.row_tweet, guardian, incorrect); Tweet t = tweetsList.get (status); *** TextView Title = (TextView) ConvertviewFindvubid (RIDTTT); *** TextView Body = (TextView) ConvertviewFindViewID (RTDBBB); Title.setText (t.getTitle ()); Body.setText (t.getBody ()); Return Convertview; }
You have to check whether convertView
is non-null
and if it is null
You should also take a look at
Comments
Post a Comment