I’m attempting to develop an application for my Android device, and I seem to be having trouble. I’m trying to have a TextView (or another component) at the top of the Activity, and a Listview beneath it. The problem that I’m having is that if I have more than just the ListView in the layout, it doesn’t render. So since I’m trying to have a TextView and ListView, only the TextView is being shown.
layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<TextView
android:id="@+id/text_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/test_string"/>
<ListView
android:id="@+id/list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:entries="@array/list_contents" >
</ListView>
</LinearLayout>
I have also tried setting the layout_height to _wrap\_content_ , but it didn’t change anything.
Add the following code to ur linear layout