Ah, ok, I must have misunderstood this line in your log (taking it to mean the return from getView).

>> 09-24 16:02:20.688: DEBUG/MGCM(357): About to return view <<

Anyway, you could assign the adapter right away, and just make it return 0 from getView if there is no data yet.

-- Kostya

24.09.2011 22:00, Eric Carman ?????:
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

--
Kostya Vasilyev

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

Reply via email to