Note that there are some explanatory texts on larger screens.

plurals
  1. POerror opening trace file: no such file or directory (2), also strings.xml not updated
    primarykey
    data
    text
    <p>I'm creating an 8 ball application and I'm using reflection to grab the strings out of the strings.xml file and in to an ArrayList but all its doing is finding the default strings in there (even the hello_world-- one which I deleted) also, I don't know how to get the string value out of the Field class that it's in.</p> <p>the first System.out.println() [the amount of fields] comes out as 4. they are all the default values of the default strings.xml file, it hasn't updated or seen the added/deleted resources.</p> <p>also it's coming up with that weird trace file error</p> <p>in the debugger, ansStuff is coming up with a size of 23... [the amount its suppose to be [ not 4..]] so weird</p> <pre><code> Field[] ansStuff = R.string.class.getFields(); System.out.println(R.string.class.getFields().length); for(Field x :ansStuff){ System.out.println(x); System.out.println(x.getName()); System.out.println(x.toString()); if(x.getName().startsWith("ans")){ choices.add(/*the goddamned string*/"poop"); } } </code></pre> <p>which after taking out the debugging mess just translates to this </p> <pre><code> for(Field x :R.string.class.getFields()) if(x.getName().startsWith("ans")) choices.add(/*what do I add here to get the string value from the field in to the arraylist */); </code></pre> <p>here is the resource file</p> <pre><code>&lt;resources&gt; &lt;string name="app_name"&gt;8ballRotate&lt;/string&gt; &lt;string name="menu_settings"&gt;Settings&lt;/string&gt; &lt;string name="title_activity_main"&gt;MainActivity&lt;/string&gt; &lt;string name="ans0"&gt;It is certain&lt;/string&gt; &lt;string name="ans1"&gt;It is decidedly so&lt;/string&gt; &lt;string name="ans2"&gt;Without a doubt&lt;/string&gt; &lt;string name="ans3"&gt;Yes – definitely&lt;/string&gt; &lt;string name="ans4"&gt;You may rely on it&lt;/string&gt; &lt;string name="ans5"&gt;As I see it, yes&lt;/string&gt; &lt;string name="ans6"&gt;Most likely&lt;/string&gt; &lt;string name="ans7"&gt;Outlook good&lt;/string&gt; &lt;string name="ans8"&gt;Yes&lt;/string&gt; &lt;string name="ans9"&gt;Signs point to yes&lt;/string&gt; &lt;string name="ans10"&gt;Reply hazy, try again&lt;/string&gt; &lt;string name="ans11"&gt;Ask again later&lt;/string&gt; &lt;string name="ans12"&gt;Better not tell you now&lt;/string&gt; &lt;string name="ans13"&gt;Cannot predict now&lt;/string&gt; &lt;string name="ans14"&gt;Concentrate and ask again&lt;/string&gt; &lt;string name="ans15"&gt;Don\'t count on it&lt;/string&gt; &lt;string name="ans16"&gt;My reply is no&lt;/string&gt; &lt;string name="ans17"&gt;My sources say no&lt;/string&gt; &lt;string name="ans18"&gt;Outlook not so good&lt;/string&gt; &lt;string name="ans19"&gt;Very doubtful&lt;/string&gt; &lt;/resources&gt; </code></pre>
    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.
 

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