android - doInBackground(String... urls) ends incomplete AsyncTask -


onPostExecute () generally runs after the doInBackground () ends..I put Log.e () at the end of doInBackgound Tried to do) but I do not see any message in the log ... I'm making it difficult to leave frames messages, I am using asynctask.

  the class extends the RssFeedTask AsyncTask; String, zero, string & gt; {Progressive dialogue dialog; String feedback = ""; Activity reference; ArrayList & LT; MyItem & gt; Most recent item = new arreelist & lt; MyItem & gt; (); MyListAdapter adapter; XmlPullParser xpp; Boolean show all; Public Risks Feed Tasks (Activity References, Boolean Show All) {this.context = context; This.showAll = showAll; } @ Override Protected Zero at Prexactec () {Dialogue = New Progress Diigo (Reference); Dialog.setMessage ("Loading ..."); Dialog.show (); } @ Override protected string doInBackground (string ... url) {try {XmlPullParserFactory factory = XmlPullParserFactory.newInstance (); Factory.setNamespaceAware (wrong); Xpp = factory.Neopolis (); {String for feed}: {xpp.setInput (getInputStream (new URL), "UTF_8"); MostLatestItems.addAll (getLatestArticles (feed, showAll)); }} Hold (exception e) {} return reaction; } @Overreaded Protected Zero at PostXextEC (string result) {max = bubblestort (highest max); Adapter = new MyListAdapter (reference, most max); (HasListView reference) .getListView (). SetAdapter (adapter); (HasListView reference) .getListView (). SetOnItemClickListener (New OnItemClickListener) {@Override} ITEMClick on Public Zero (adapter view> lt ;? & gt; parent, view view, integer position, long ID) {string URL = (MyItem adapter GetItem (status)). GetLink (); I = new intent (Intent.ACTION_VIEW); I.setData (Uri.parse (url)); Context.startActivity (i);}}); Dialog.dismiss (); } Public Arrestist & lt; MyItem & gt; GetLatestArticles (String Feed URL, Boolean ShowL) {ArrayList & lt; MyItem & gt; RssList = New Arrestist & lt; MyItem & gt; (); My item item = null; Try {Inside Boolean = ITEM = False; Int Event Type = xpp.getEventType (); While (eventType! = XmlPullParser.END_DOCUMENT) {if (eventType == XmlPullParser.START_TAG) {if (xpp.getName (.) Equal to ignoreCase ("item")) {insideItem = true; } Else if (xpp.getName (). Equally ignoredCase ("title")) {if (insideItem) item.setHeadLine (xpp.nextText ()); } Else if (xpp.getName (). Equal ignoreCase ("link") {if (insideItem) item.setLink (xpp.nextText ()); } And if (xpp.getName (.) Ignore equally ("url") {if (insideItem) item.setIconSrc (xpp.nextText ()); } And if (xpp.getName (.) Ignore equally ("pubadet")) {if (insideItem) item.setPubDate (xpp.nextText ()); }} And if (eventType == XmlPullParser.END_TAG and XP.Getname (). Ignore equals ("item")) {insideItem = false; RssList.add (item); If brake (showAll!); } EventType = xpp.next (); }} Hold (malformedlexception e) {e.printStackTrace (); } Hold (XmlPullParserException e) {e.printStackTrace (); } Hold (IOException e) {e.printStackTrace (); } Return RSS list; } Public InputStream getInputStream (URL URL) {try {url.openConnection (). GetInputStream (); } Hold (IOException e) {return tap; }} Private Arrestist & lt; MyItem & gt; Bullshort (Arrestist & lt; MyItem & gt; a) {int i, j; Maitime T = Null; Int n = a.size (); (I = 0; i & lt; n; i ++) for {for (j = 1; j & lt; (n - i); j ++) {if (a.get (j - 1) GetPubDate (.) Compare (a .get (j) .getPubDate ()) == 1) {T = A.jet (J-1); A.set (j - 1, a.get (j)); A.set (j, t); }}} Return; }}   

xml link: "", ""

You are trying to set up a list with something that has been parsed in the doInBackground function

On this code block on PostExecute

  for (string feeds: Url) {xpp.setInput (getInputStream (new URL), "UTF_8"); MostLatestItems.addAll (getLatestArticles (feed, showAll)); }    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -