Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6241467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:46:23+00:00 2026-05-24T11:46:23+00:00

I have create following structure. Here levels are up to 4 and groups are

  • 0

I have create following structure. Here levels are up to 4 and groups are up to 6 same xml file structure.But i cannot access as level1 -> group1-> first item, which has also to item. Here total level has 4 and each level has 6 individual group and each individual group has 10 individual items.

 <resources>
     <string-array name="level1">       

       <item>
            <string-array name="group1"> 
            <item>
                 <string-array>
                    <item>the</item>
                    <item>the little boy</item>         
                 </string-array>
            </item>        
            <item>
                 <string-array>
                    <item>a</item>
                    <item>a good boy</item>         
                  </string-array>
            </item>
        </string-array>
      </item>   

      <item>
        <string-array name="group2"> 
             <item>
                <string-array>
                   <item>he</item>
                   <item>he is it</item>            
                </string-array>
             </item>           
             <item>
                <string-array>
                     <item>i</item>
                      <item>i can go</item>         
                  </string-array>
                       ...
              </item>
               ...  
       </string-array>
             ...
   </item>  
...
</string-array>

Here some code, that i try….

        final String  levels []=getResources().getStringArray(R.array.level);
        final TextView tw=(TextView)findViewById(R.id.txtWord);
         String group1=levels[0];   

        final String  groups []=getResources().getStringArray(R.array.group);
        String item1=groups[0];
        tw.setText(item1);

So, would you please give me any ideas behind this problem. My ultimate goal is, Choose Level1->Group1-> Then Click the next button and show up 1 word at time and repeatedly(Never finish or circular way).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T11:46:24+00:00Added an answer on May 24, 2026 at 11:46 am

    So you want to iterate over a group of strings?
    Why not using plain strings with indices?

    <string name="string_deftype">string</string>
    <string name="mylexicon_identifier">level_%1$d_group_%2$d_word_%3$d</string>
    
    <string name="level_1_group_1_word_1">the</string>
    <string name="level_1_group_1_word_2">the little boy</string>
    ....
    <string name="level_2_group_2_word_1">i</string>
    <string name="level_2_group_2_word_2">i can go</string>
    

    And then in your Activity or Context

    this.getResources().getIdentifier(getString(R.string.mylexicon_identifier, index_level, index_group, index_word), getString(R.string.string_deftype), getApplicationContext().getPackageName()));
    

    So what you basically can do with this:

    loop levels
      loop groups
        loop words
    

    Whereas you have to check in your loops if the appropriate resource exists (look into the documentation)

    getIdentifier() != 0
    

    Keep in mind, that this approach is not a very fast one as mentioned in the documentation.
    I hope this helps.

    PS: You could also use a database of course.^^

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a table with the following structure- $sql = CREATE TABLE followers
I have the following table structure CREATE TABLE `table` ( `id` int(11) NOT NULL
Lets say I have the following MySQL structure: CREATE TABLE `domains` ( `id` INT(10)
If I have a requirement to create a data structure that has the following
I have a sample file like the following: CREATE GLOBAL TEMPORARY TABLE tt_temp_user_11 (
I have the following table structure in my database: create table Encargado( ID int
I have a stored procedure with the following structure: CREATE PROCEDURE MyStoredProcedure(IN code INTEGER)
I have a simple text file containing some CSV with the following structure: @Parent1_Field1,
I have a SQL database table with the following structure: create table category_value (
Within a child, I have an XML element with the following structure: <position> <startOffset>*NUMBER*</startOffset>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.