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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:58:17+00:00 2026-06-02T21:58:17+00:00

Hi Android developers, I need a class for a part of my program. Let

  • 0

Hi Android developers,

I need a class for a part of my program. Let me describe the problem for you.

I need to have a class that lets me scroll down a list of “items” that I can click. Also, this list of items can grow (expand) or shrink as needed, like an ArrayList.

I saw the class ScrollView, but does this fulfill all of the requirements I need?

If not, what is the best class to use in my main.xml file to accomplish this task?

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-06-02T21:58:18+00:00Added an answer on June 2, 2026 at 9:58 pm

    You can try using ListView in your XML file and then populate the listview from an Arraylist. Something like this will work for you.

    public class YourActivity extends Activity 
    {
    private ListView lv;
    public void onCreate(Bundle saveInstanceState) {
         lv = (ListView) findViewById(R.id.your_list_view_id);
         // Instanciating an array list (you don't need to do this, you already have yours)
         ArrayList<String> your_array_list = new ArrayList<String>();
         your_array_list.add("a");
         your_array_list.add("b");
         // This is the array adapter, it takes the context of the activity as a first // parameter, the type of list view as a second parameter and your array as a third parameter
         ArrayAdapter<String> arrayAdapter =      
         new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, your_array_list);
         lv.setAdapter(arrayAdapter); 
         setContentView(R.layout.your_layout);
    
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two android applications that I have developed. I need to compare the
I have an Android Activity that uses a class that I developed that extends
After following these steps: http://developers.facebook.com/docs/mobile/android/build/ I find that everything goes well, but when I
Is there something in the Android developer guidelines that disuades developers from providing the
I'm defining an abstract base class as a part of an API that will
I have developed some reusable android component which is basically a class . This
As per the android developer docs for creating tab UI you need to have
I have a mapview, with itemizedoverlays, exactly like in the example of android developers
I found this on android developers when i was trying to program a button:
I need a little help with this: android developers, Tutorials: OpenGLES10. a link It

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.