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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:49:34+00:00 2026-05-31T06:49:34+00:00

I have a array of words and I would like to print the array

  • 0

I have a array of words and I would like to print the array of words onto the screen in a text view after a button is clicked. i was using a for loop to go through the whole list and then set text, but i keep getting a error with that plus it will just replace the last value, so it wont print the whole array. If anybody could explain to me how to do like a g.drawSting() but android version that would be great. my code rt now is not with me but it something like:
-I’m a beginner to android btw, probably could tell by this question tho.

public void onCreate(Bundle savedInstanceState)
{
//code for a button just being pressed{
 //goes to two methods to fix the private array{
     for(int y=0; y<=array.size()-1; y++){
        textArea.setText(aarray.get(y));   //prints all strings in the array
 }
}
}
  • 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-31T06:49:36+00:00Added an answer on May 31, 2026 at 6:49 am
    int arraySize = myArray.size();
    for(int i = 0; i < arraySize; i++) {
    myTextView.append(myArray[i]);
    }
    

    if you want to print one by one, then use \n

    myTextView.append(myArray[i]);
    myTextView.append("\n");
    

    PS:
    Whoever suggesting to change .size() to .length(), thanks for you suggestion.

    FYI,
    The questioner mentioned the variable name is array.size() in question, so the answer also having the same variable name, to make it easier for the questioner.

    if your variable (myArray) is an Array use myArray.length(), if it is ArrayList use myArray.size()

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

Sidebar

Related Questions

I would like to maintain a pidlist array of children I have forked and
I have seven words in the array: string[7] = {x,x,x,x,x,x,x}; the x is generated
I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]
An array is defined of assumed elements like I have array like String[] strArray
If I do the following, it works fine: print $ref->{element}->[0]->{data}; I would like to
Basically I have this string $str=word1 word2 word3; I need array( 'word1', 'word2', 'word3'
I have array of select tag. <select id='uniqueID' name=status> <option value=1>Present</option> <option value=2>Absent</option> </select>
I have array of strings, String[] data and it's 10 elements has value P
if i have array array[0] = jack; array[1] = jill; array[2] = lisa; array[2]

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.