Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to display 2 No Results Found text when search result is not found? In Android
    primarykey
    data
    text
    <p>I have 2 <code>TextViews</code> and 2 <code>ListViews</code> and an <code>EditText</code> in my main xml file.</p> <p>The "Search" <code>EditText</code> is first, then "Tools" <code>TextView</code>, then "Tools" <code>ListView</code>, then "Articles" <code>TextView</code>, then "Articles" <code>ListView</code>.</p> <p>What I wanted to do is display <code>"No Results Found for Tools"</code> when someone type in a word (i.e "test") and it does not exists in my sql, I want to display this in my tools section and <code>"No Results found for Articles"</code> in my articles section</p> <p>My main problem is, when I run the project, it has a huge space between the textViews. It looks like this</p> <pre><code>No Results Found in Tools No Results Found in Articles. </code></pre> <p>The output that I want to achieve is:</p> <pre><code>No Results Found in Tools No Results Found in Articles </code></pre> <p>I tried setting the visibility of the listview to gone but still doesn't work. Can you help me?</p> <p>EDIT: here is my xml layout for this</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:orientation="vertical" &gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/navbar_search" android:paddingLeft="5dp" &gt; &lt;ImageView android:id="@+id/buttonBack" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_centerVertical="true" android:src="@drawable/btn_back" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/violet" android:padding="5dp" &gt; &lt;EditText android:id="@+id/editTextSearch" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="@string/hint_search" android:paddingLeft="35dp" &gt; &lt;/EditText&gt; &lt;ImageView android:id="@+id/imageView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/editTextSearch" android:layout_centerVertical="true" android:layout_marginLeft="5dp" android:src="@drawable/search" /&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@color/blue" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="5dp" &gt; &lt;TextView android:id="@+id/textArticlesResult" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="5dp" android:text="@string/label_articles" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@color/black" android:textStyle="bold" /&gt; &lt;ListView android:id="@+id/listViewArticlesResult" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/textArticlesResult" android:cacheColorHint="@color/white" android:fadeScrollbars="false" &gt; &lt;/ListView&gt; &lt;/RelativeLayout&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1" android:background="@color/blue" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="5dp" &gt; &lt;TextView android:id="@+id/textToolsResult" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" android:text="@string/label_tools" android:textAppearance="?android:attr/textAppearanceMedium" android:textColor="@color/black" android:textStyle="bold" android:layout_below = "@id/listViewArticlesResult" /&gt; &lt;ListView android:id="@+id/listViewToolsResult" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/textToolsResult" android:cacheColorHint="@color/white" android:fadeScrollbars="false" &gt; &lt;/ListView&gt; &lt;/RelativeLayout&gt; &lt;LinearLayout android:layout_width="match_parent" android:layout_height="46dp" &gt; &lt;ImageView android:id="@+id/tabHome" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/desc" android:scaleType="fitXY" android:src="@drawable/tab_home_unselected" /&gt; &lt;ImageView android:id="@+id/tabFb" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/desc" android:scaleType="fitXY" android:src="@drawable/tab_fb_unselected" /&gt; &lt;ImageView android:id="@+id/tabSearch" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/desc" android:scaleType="fitXY" android:src="@drawable/tab_search_selected" /&gt; &lt;ImageView android:id="@+id/tabFaves" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/desc" android:scaleType="fitXY" android:src="@drawable/tab_myfaves_unselected" /&gt; &lt;ImageView android:id="@+id/tabSettings" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:contentDescription="@string/desc" android:scaleType="fitXY" android:src="@drawable/tab_settings_unselected" /&gt; &lt;/LinearLayout&gt; &lt;/LinearLayout&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload