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 7706491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:08:18+00:00 2026-06-01T00:08:18+00:00

I use Objects (beans) that we’ll call Category. These Category objects contain a set

  • 0

I use Objects (beans) that we’ll call Category.
These Category objects contain a set of attributes including a list of Category objects.

public class Category {
     private List<Category> categoryList;
     ...
     private Strings anAttribute;
}

At compilation, I do not know the depth of the root Category object, meaning : how many Category are in the list of the root Category and how many Category objects are in each one of the list and so go on. I actually get the root Category object by parsing an XML file.

I have an activity, which, to resume, shows a set of buttons. Each button represents a root Category object (each from an XML file). I would like that once I click on one of these buttons, I get a new “window” showing a set of buttons (a button per Category in the List) and each of this button shows recursively a new “window” showing a set of buttons…

How could I do that knowing I’d like to use XML files for the contents I want to display ? I guess the point is not to create an activity per Category (even dynamically).

Thank you for your help.

  • 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-06-01T00:08:20+00:00Added an answer on June 1, 2026 at 12:08 am

    You could use the following structure:

    private LinearLayout myLayout;
    
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.something);
    
        myLayout = (LinearLayout) findViewById(R.id.my_layout);
        createBtns( loadFirstCategory() );
    }
    
    private void createBtns(Category c)
    {
        List<Category> c_list = c.getCategoryList();
        for (int i=0; i<c_list.size(); i++)
        {
            Button btn = new Button(this);
            btn.setText( c_list.get(i).getName() );
            myLayout.addView(btn);
    
            btn.setOnClickListener(new OnClickListener() {
                public void onClick()
                {
                    myLayout.removeAll();
                    createBtns( c_list.get(i) );
                }
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a template class where I want to use objects of that class
Can VBA code instantiate and use .NET objects? The specific class I'm interested in
I have a bunch of java custom tags that use spring managed beans.. since
I'm trying to use plain old java objects(POJO)'s and regular class files where needed
I have two objects: public class ParentObject { // some basic bean info }
springframework.beans.BeanUtils is very useful to copy objects, and I use the ignoreProperties option frequently.
We have a Hibernate/Spring application that have the following Spring beans: <bean id=transactionManager class=org.springframework.orm.hibernate3.HibernateTransactionManager
I'm using Spring 3.0.4. I have some beans that use the @Autowired annotation on
Is there a way to make jQuery use objects in a conditional statement as
In Visual Studio, I often use objects only for RAII purposes. For example: ScopeGuard

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.