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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:31:50+00:00 2026-06-11T03:31:50+00:00

The content of xml are <AbsoluteLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/MainFrame android:layout_width=match_parent android:layout_height=match_parent > <AbsoluteLayout android:id=@+id/AbsoluteLayout1 android:layout_width=match_parent

  • 0

The content of xml are

<AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/MainFrame"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<AbsoluteLayout
    android:id="@+id/AbsoluteLayout1"
    android:layout_width="match_parent"
    android:layout_height="172dp"
    android:layout_x="12dp"
    android:layout_y="26dp"
    android:visibility="invisible" >

</AbsoluteLayout>

  <AbsoluteLayout
    android:id="@+id/AbsoluteLayout2"
    android:layout_width="match_parent"
    android:layout_height="172dp"
    android:layout_x="20dp"
    android:layout_y="184dp" android:visibility="invisible">

</AbsoluteLayout>

</AbsoluteLayout>

Here’s the main code

String layoutid;
int ctr = 1;
AbsoluteLayout [] mainlayout = new AbsoluteLayout[12];

   while (ctr<3)
   {
        layoutid = "AbsoluteLayout" + ctr;
        mainlayout[ctr] = (AbsoluteLayout)findViewById(R.id.layoutid);
        ctr++;
   }

We need to make a loop to make

 ctr = 1 
 AbsoluteLayout + ctr = AbsoluteLayout1 
 ctr++; 

 AbsoluteLayout + ctr = AbsoluteLayout2

we want to declare the AbsoluteLayout1 and AbsouluteLayout2 but it doesn’t work. We know that the R.id.layoutid is the culprit. So how can we resolve it?

  • 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-11T03:31:51+00:00Added an answer on June 11, 2026 at 3:31 am

    I solved it using getIdentifier method

    Button[] buttons; 
    for(int i=0; i<buttons.length; i++) {
    {
       String buttonID = "sound" + (i+1);
    
       int resID = getResources().getIdentifier(buttonID, "id", getPackageName());
       buttons[i] = ((Button) findViewById(resID));
       buttons[i].setOnClickListener(this);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<?xml version=1.0 encoding=utf-8?> <AbsoluteLayout xmlns:android=http://schemas.android.com/apk/res/android android:layout_width=wrap_content android:layout_height=250px android:id=@+id/dialog_layout_root> <AbsoluteLayout android:layout_width=wrap_content android:layout_height=wrap_content> <TextView android:id=@+id/dialogtext android:layout_width=fill_parent
I've got the following main.xml: <?xml version=1.0 encoding=utf-8?> <AbsoluteLayout android:id=@+id/widget0 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android >
I have input xml of the form <content xml:lang=en xmlns:w=http://www.w.com/sch/W> <w:firstRowHeader>true</w:firstRowHeader> <w:firstColumnHeader>true</w:firstColumnHeader> <w:customTable> <w:tableContent>
While generating an XML content, I get an empty node <node/> , and I
I'm trying to echo the XML content at this URL but I'm having difficulty.
What are your thoughts on binary content in XML vs. mere references to the
I have written simple code to get content from xml file to php. $xml
I wanted to remove the review section content from XML response I received from
I found another similar question: Best way to download images from XML content in
Content of profile.xml: <files> <file folder=CaptureServer filename=CSConfig object=CSConfig> <Profile name=BBH1200Kofax> <OutputCache>\</OutputCache> <EncryptedConnectionString>564rgr=</EncryptedConnectionString> <ConvertDocsBeforeRelease>false</ConvertDocsBeforeRelease> </Profile>

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.