Saturday, September 24, 2011

Re: [android-developers] Fragment Compatibility Library SDK 1.6/2.1 Exception

Thank you for your response.

I tried what you suggested. The getView code snippet from the base adapter is here. It definitely would return a non-null value, but the error above appears to happen before this gets a chance to be called. (The debug statement didn't get executed.)

public View getView(int position, View convertView, ViewGroup parent) {

FeedListItem temp = (FeedListItem) mBlogFeed.getListFeed().get(
position);

convertView = mInflater.inflate(R.layout.rowlistviewtitledescr,
null);
TextView itemTitle = (TextView) convertView
.findViewById(R.id.textviewListViewTitle);
TextView itemDescr = (TextView) convertView
.findViewById(R.id.textviewListViewDescr);
itemTitle.setText(temp.getTitle());

Date pub = (temp.getPubDate());
Date upd = (temp.getUpdDate());

String datetext;
if (pub.getYear() == 0) {
datetext = "Unknown";
}
else {
datetext = mDateFormat.format(pub);
if (upd.getYear() != 0 && upd.compareTo(pub) != 0) {
datetext += " (Upd: " + mDateFormat.format(upd) + ")";
}
}
itemDescr.setText(datetext);

if (Constants.DEBUGGING) {
Log.d(Constants.LOG_TAG, "convertView is Null: "
+ Boolean.toString(convertView == null));
}
return convertView;
}

In fact, from what I can tell, the issue is occurring during the layout of the screen widgets. I don't assign the adapter to the listview until after the data is retrieved. The error is occurring before that has happened - you can see on the onPostExecute above where the adapter gets assigned and the debug statements didn't get logged. And, of course, it works quite well when run on devices with an SDK >= 2.2 (even tablets). This is the vexing part.

I'm starting to follow your lead and diving into the source code to see if I can find some sort of clue.

Thank you again for your suggestion.

Best Regards,
Eric

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate