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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:16:30+00:00 2026-06-14T21:16:30+00:00

I have an ArrayList which get all it’s entries as strings from DB List<Amthal>

  • 0

I have an ArrayList which get all it’s entries as strings from DB

List<Amthal> amthal = getAmthalSetFromDb(p);

I can get it’s size “how many strings it contains”

int i= amthal.size();

I want to view these strings in TextView one after the another by clicking next button to move to next one

I tried to view any string in that array list but I got an error… “get(i-1)” which must return last string in that array …

    tv.setText(amthal.get(i-1));

my question is how to retrieve and view these strings ? should I convert it to Array of strings or what??

  • 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-14T21:16:32+00:00Added an answer on June 14, 2026 at 9:16 pm

    You can solve your issue by using an counter varaible as :

    public static int count=0;  //Declare it as class level varaible
    yourbutton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
    
        if(count < amthal.size())
             {
                  tv.setText(amthal.get(count).toString()); //set textView Text here
                  count++;  // increase counter here
             }
             else{
                //Reset counter to 0
              }
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a List of List<String> 's which I get from a external API
I have an arraylist called fetchContactName() which returns all names (31) in my contact
i have an arraylist of strings in my servlet which im passing forwarding using
I have an ArrayList that contains Strings and also contains other ArrayLists which may
I have made a custom list in which I am getting all the phone
:) My RadioGroup's RadioButtons get dynamically created from an ArrayList (which resides in my
I want to get all the objects from the list and put them into
I have a arraylist of similar objects (say toys) which I get every day.
i have an issue with the understanding the arraylist which contain the objects from
I have some Strings in java, which come from an ontology file and they

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.