Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid accessing wrong resource ... How do I solve this?
    text
    copied!<p>Last night my code was working fine, today when I load it up, <strong>the raw resource I access in my code is trying to read from an id pointing to a string rather than an xml file in my raw folder.</strong></p> <p>I have used <a href="http://www.statman.info/conversions/hexadecimal.html" rel="nofollow noreferrer">http://www.statman.info/conversions/hexadecimal.html</a> to track the resource id's and match them to their R hex id's and I can SEE that it should be accessing 0x7f040002 but is accessing 7f060000 for some reason...</p> <p><strong><em>I have already looked at :</em></strong> <a href="https://stackoverflow.com/questions/5919479/accessing-wrong-raw-resource-in-android">Accessing wrong raw resource in Android</a></p> <p><strong>I have done all of the following:</strong></p> <ol> <li>Clean, Rebuild, Run. </li> <li>Delete R, Reboot Eclipse, Clean, Rebuild, Run</li> <li>Delete R, Clean and Rebuild Immediately, Reboot</li> <li>UmbySlipKnot's idea of deleting Gen Folder + all of the above.</li> <li>Making sure Android.R is not being used anywhere.</li> <li>Printed the actual resource id I am expecting to use by calling (returns expected id correctly!): </li> </ol> <p>int resId=con.getResources().getIdentifier("raw_tsn_xml_amina_simple","raw",con.getPackageName());</p> <p><em>Also rebuilt the project entirely from scratch. <strong>No matter what I do - it's always getting app name as the resource id it references for the Input Stream</strong> - source</em></p> <p>None of these have worked for me... <strong>Does anyone have any ideas what else I can try?</strong></p> <p><strong>I have also added images to show you what I noticed:</strong></p> <p><strong>Debug Snippet:</strong> <img src="https://i.stack.imgur.com/CpUwG.png" alt="enter image description here"></p> <p><strong>Android R File Snippet:</strong> <img src="https://i.stack.imgur.com/MdiSA.png" alt="enter image description here"></p>
 

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