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

  • Home
  • SEARCH
  • 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 7036599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:26:36+00:00 2026-05-28T01:26:36+00:00

My button is: <Button android:text= android:id=@+id/b1 android:gravity=center_horizontal android:layout_width=100dp android:layout_height=100dp android:background=@drawable/the_border android:textSize=75sp/> And I have

  • 0

My button is:

  <Button
      android:text=""
      android:id="@+id/b1"
      android:gravity="center_horizontal"
      android:layout_width="100dp"
      android:layout_height="100dp"
      android:background="@drawable/the_border"
      android:textSize="75sp"/>

And I have many of them (b0, b1, b2)…

My java:

    for(int index = 0; index < 9; index++)
    {
        places[index] = (Button) findViewById(R.id.b + index);
        places[index].setOnClickListener(this);
    }

How could I do this? findViewById(R.id.b + index) needs to be changed. Is it possible? Thanks

  • 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-28T01:26:37+00:00Added an answer on May 28, 2026 at 1:26 am

    Use the tag property to give them sequential tags of 0, 1, 2, etc., then findViewWithTag() in a loop to build an array. Note that tag is a string, it’s not numeric.

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

Sidebar

Related Questions

I'm having trouble with button text alignment in my Android app. I have a
This is what I have: <?xml version=1.0 encoding=utf-8?> <LinearLayout android:id=@+id/LinearLayout01 android:layout_width=fill_parent android:layout_height=fill_parent xmlns:android=http://schemas.android.com/apk/res/android android:orientation=vertical
I have to create a custom compound button bar control in Android like the
I have an android listview filled with items. Every item has a button. This
I'm having some trouble getting my button text to align correctly in my Android
I have a layout for an Android activity in which the second button is
This is my layout: <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/LinearLayout1 android:layout_width=fill_parent android:layout_height=fill_parent android:orientation=vertical > <LinearLayout xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/LinearLayout2
I am creating an Android app, and I have a button with a custom
i want to put Go button in android appliation softkeyboard for search and other
I am trying to set textColor property of button in android 2.1. But I

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.