Note that there are some explanatory texts on larger screens.

plurals
  1. POAnnoying Android - RSS problem
    primarykey
    data
    text
    <p>I'm struggling big time with a stupid problem which i can't seem to fix. Basicly what i do in my application is the following:</p> <p>I download all the RSS content to a local database, including the enclosure of every feed (images) but not every feed contains an image.</p> <p>about 10 of the 100 feeds don't contain an image What happens with the feeds that don't contain an image is shown in the following image:</p> <p><a href="http://i.stack.imgur.com/FTUBl.png" rel="nofollow">http://i.stack.imgur.com/FTUBl.png</a></p> <p>The feeds with no image get the image of the previouse feed for some reason...</p> <p>I'll place all my code below in hope someone can tell me what in the world i'm doing wrong...</p> <p>This part is where i download the image to the local storage, this function works correctly however for some reason the feed with no enclosure gets the enclosure of the previouse feed send back to it...</p> <pre><code>for (Message msg : wildLife){ String imageURL = msg.getEnclosure(); String imageName = imageURL.substring(imageURL.lastIndexOf("/")); String imagePath = ImageDir + imageName; //-- Call upon the function that will download the image. if (imageURL !=null){ DownloadFromUrl(imageURL, imagePath); } //-- We add all rows we find in the rrs feed to our local stored database. db.addWildlifeRow( msg.getTitle(), msg.getDescription(), "Empty slot", imagePath, msg.getLink()); } </code></pre> <p>I checked in the RSS parser and it doesn't store the same URL twice. So no problem there. It goes wrong (for as far as i know) when requisting the URL enclosure from a message item.</p> <p>Is there anyone who might have encountered this same problem? </p> <p>All advice is welcome i've been stuck in this problem for days now, and i can't seem to figure it out...</p> <p>If you would require more code to find a possible solution just ask and i will provide it.</p> <p>P.S. it goes wrong before placing the data into my database, so when reading the info from the message out and placing it in the database, its already gone wrong there. The enclosure is copied from the reviouse one (if there was none)</p> <p>Regards, joery</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload