{"id":5301,"date":"2014-03-30T20:33:19","date_gmt":"2014-03-30T20:33:19","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/android-accessing-wrong-resource-how-do-i-solve-this-collection-of-common-programming-errors\/"},"modified":"2014-03-30T20:33:19","modified_gmt":"2014-03-30T20:33:19","slug":"android-accessing-wrong-resource-how-do-i-solve-this-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/android-accessing-wrong-resource-how-do-i-solve-this-collection-of-common-programming-errors\/","title":{"rendered":"Android accessing wrong resource &hellip; How do I solve this?-Collection of common programming errors"},"content":{"rendered":"<p><strong>Apparently the eclipse debugger is not as dependable as I expected.<\/strong><\/p>\n<p>While I was working with the debugger, I noticed that resource ID is correctly being found, but when I really nitpick into the debugger, the inputStream seemed to be getting built from another source.<\/p>\n<p><em>I thought that was the reason my code was crashing, but it wasn&#8217;t.<\/em><\/p>\n<p>I use a SIMPLE xml android library &#8211; if the xml you pass it is in an unexpected\/invalid format, it can&#8217;t build the data models you create <em>(My XML was invalid &#8211; therefore the crash).<\/em><\/p>\n<p>I did a roll back to notice that new XML I had added, <em>crashed the run.<\/em><\/p>\n<p><strong>The debugger just cranked out&#8230; giving me nulls when things weren&#8217;t null, showing different values even when my logs were printing correct values!<\/strong><\/p>\n<p>Once I saw this hapenning, I didn&#8217;t trust the debugger as much as I ususally do.<\/p>\n<p>My advice : If the simpler solutions on this page have not worked for you &#8211; Take the following steps:<\/p>\n<ol>\n<li>\n<p>Suspect code additions first! If something you added suddenly breaks your working code, <strong>it&#8217;s probably your own error<\/strong>.<\/p>\n<\/li>\n<li>\n<p>If your debugger acts weird, print useful log information <strong>(It is much faster)<\/strong> to give you the right information in the right places.<\/p>\n<\/li>\n<\/ol>\n<p><em>These are the exact steps I took to find the root of the problem.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Apparently the eclipse debugger is not as dependable as I expected. While I was working with the debugger, I noticed that resource ID is correctly being found, but when I really nitpick into the debugger, the inputStream seemed to be getting built from another source. I thought that was the reason my code was crashing, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5301","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5301","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=5301"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5301\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}