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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:05:26+00:00 2026-05-27T00:05:26+00:00

i have an android application which has a listview for listing 14 items inside

  • 0

i have an android application which has a listview for listing 14 items inside it. i have coded as

<LinearLayout android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
        <ListView android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:clickable="true"
            android:id="@+id/my_list"/>
    </LinearLayout>

and my activity file is working as

ListView list;
list = (ListView)findViewById(R.id.my_list);
ArrayAdapter<CharSequence> list_adapter= ArrayAdapter.createFromResource(
        this, R.array.my_array, android.R.layout.simple_list_item_1);
my_list.setAdapter(list_adapter);

The code works properly. but i want to reduce the size of listview, so that i can list maximum items in the screen.

how can i do this? i had searched it. but didnt find any useful guidance.

  • 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-27T00:05:27+00:00Added an answer on May 27, 2026 at 12:05 am

    Got it dear…

    Its simple…

    I had just made my own layout in R/layout as mylist.xml

    <?xml version="1.0" encoding="utf-8"?>
        <TextView xmlns:android="http://schemas.android.com/apk/res/android"
                  android:layout_width="fill_parent"
                  android:layout_height="wrap_content"
                  android:textSize="7pt"    
                  android:paddingTop="2dip" 
                  android:paddingBottom="2dip"
                  android:textColor="@android:color/black"   
                  android:gravity="center"/>
    

    and then i changed my main.xml to show a listview. like,

    <LinearLayout android:orientation="horizontal"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent">
            <ListView android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:id="@+id/my_list"/>
        </LinearLayout>
    

    And atlast i have my actvty file like

        // all the stuff
        // i cant put my code here,na?:)
       //Its simple. just change layout to ours
        ListView list;
        list = (ListView)findViewById(R.id.my_list);
        ArrayAdapter<CharSequence> list_adapter= ArrayAdapter.createFromResource(
                this, R.array.my_array, R.layout.mylist);
        my_list.setAdapter(list_adapter);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been developing Android application which has 3 ListView and one ContextMenu for
Hello I have an android application which has a service running. After 20 mins
I am building an android application which has a listview and when the user
I have an android application which contains four modules(I mean four apk's).Each module has
I have built an android application which has a single mapview. I have a
I have an Android application which has the main UI thread, and several other
I have an Android application which has a login screen. Upon the click of
Im new to android. i have tried to built an application which has 2
I have an Android application which has four tabs (I use a main TabActivity
I have an Android application from which I want to upload some data to

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.