MY Solution to Toast Challenge


#1

It is so simple its just in your xml file . just check for the starting tag containing the keyword “photos”. inside this tag find the name "total"
here is the code:

if(tagType==XmlPullParser.START_TAG && XML_PHOTOS.equals(parser.getName())){
String total=parser.getAttributeValue(null, XML_RESULT);
setTotal(total);
}

then in your toast. after in the post execute you do this:

String toastString= getString(R.string.total_items,mFetcher.getTotal(),mCurrentPage);
Toast.makeText(getActivity(),toastString , Toast.LENGTH_LONG).show();

TOO SIMPLE TO THINK OF. PLEASE READ THE BOOK TO UNDERSTAND . DONT RUSH