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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:14:02+00:00 2026-05-29T23:14:02+00:00

I need to create one textview array, i’d like to show or hide one

  • 0

I need to create one textview array, i’d like to show or hide one image depending position.
I’ll try to explain it:
I’ve one layout similar this:

1 2 3 4 5

And depending random value show or hide an image in textview 1 or 2, etc…

I can use:

if (a == 4)

 {

t4.setBackgroundResource(R.drawable.ficha);

t1.setBackgroundDrawable(null);

t2.setBackgroundDrawable(null);

t3.setBackgroundDrawable(null);

t5.setBackgroundDrawable(null);

}

else if (a==5)

...

..

But i’d like to know, if it’s possible to pass the number t(1) using parameters or something similar.

Thanks in advance and sorry about my english.

  • 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-29T23:14:03+00:00Added an answer on May 29, 2026 at 11:14 pm

    Or you can use List<TextView> tvList = new ArrayList<TextView>();
    add as many textviews as you like

    and this will retrieve a textview and set background from a list depending on your a value :

    ((TextView)tvList.get(a)).setBackgroundResource(R.drawable.ficha+a.....); 
    

    1st 2nd and so on. you can use Arrays too of course for this purpose.


    hope it helps abit

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

Sidebar

Related Questions

I need to create one array of numbers inside one range, like: [1..5] in
I need to create application in which one textview are there to search any
I need to create a stored proc that will return records (more than one
I need to create a single trace file that spans several days for one
I need to create a batch file that reads a file with one line
I need to create and combine several expressions for child entity into one to
I have a class: class One def initialize; end end I need to create
Basically I need a hosted solution, where one can create an account for a
I need to manipulate an existing XML document, and create a new one from
I need to create one textfield custom components which accepts only credit card number

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.