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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:02:37+00:00 2026-05-16T22:02:37+00:00

Im trying to do a very simple thing (showing a populated listView) but im

  • 0

Im trying to do a very simple thing (showing a populated listView) but im not able. My code is not working and i cant find what’s wrong, so i hope someone else can help me 🙂

My XML where i have the listView defined:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="fill_parent"
  android:padding="10px">

<TextView
    android:id="@+id/descripcion"
    android:text="@string/descripcion"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"    />

<ListView
    android:id="@+id/listaConfig"
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content"    />

</LinearLayout>

The Activity:

public class s_config extends Activity {

    public ArrayAdapter<String> lvAdapter;
    public ListView lv;

    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.s_config); 

      final String[] datos = new String[]{"Elem1","Elem2","Elem3","Elem4","Elem5"};

      lvAdapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1,datos);
      lv = (ListView) findViewById(R.id.listaConfig);
      lv.setAdapter(lvAdapter);

    }
}

When i launch the app, it goes fine, the TextView of the XML is showed but no signs of the ListView… Am i missing something?

  • 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-16T22:02:38+00:00Added an answer on May 16, 2026 at 10:02 pm

    In your Xml Layout has the problem:

    set layout Orientation as vertical android:orientation="vertical" that make your listview visible.

    Note:

    If you not set the orientation its value will be horizontal as Default.

    Edited layout:

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"
      android:padding="10px"
       android:orientation="vertical">
    
    <TextView
        android:id="@+id/descripcion"
        android:text="@string/descripcion"
        android:layout_width="fill_parent" 
        android:layout_height="wrap_content"    />
    
    <ListView
        android:id="@+id/listaConfig"
        android:layout_width="wrap_content" 
        android:layout_height="wrap_content"    />
    
    </LinearLayout>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying something very simple, but for some reason it does not work.
I'm trying to do a very simple thing: Read a diff from a git
I'm trying a very simple demo of SignalR but getting the infamous undefined error
Very simple thing I am trying to do in JS (assign the values of
I am trying to do a very simple animation, but it is giving me
I'm trying to define my own (very simple) exception class in Python 2.6, but
Trying to do very simple thing. Have too many of these fields: <input name=itempriceqty0
Very simple thing I'm trying to do here. I would like to have 2
I am trying to achieve a very simple thing in MATLAB. I have a
So I am trying to do a very simple thing in WP7 like: A

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.