Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to manage listview between two buttons
    primarykey
    data
    text
    <p>I have a button ,listview and another button.Initially listview have property gone so that button2 show below of button 1,when i click on button1 ,button 2 should set on bottom of that screen and list should be visible in between both buttons.....</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"&gt; &lt;RelativeLayout android:layout_width="fill_parent" android:id="@+id/relativeLayout1" android:layout_height="wrap_content"&gt; &lt;Button android:layout_width="fill_parent" android:id="@+id/Button01" android:background="#ffffff" android:text="Button" android:layout_height="40dp"&gt;&lt;/Button&gt; &lt;ListView android:layout_height="fill_parent" android:layout_width="fill_parent" android:id="@+id/llList"&gt;&lt;/ListView&gt; &lt;Button android:layout_height="40dp" android:text="Button" android:id="@+id/button" android:background="#ffffff" android:layout_width="fill_parent"&gt;&lt;/Button&gt; &lt;/RelativeLayout&gt; &lt;/LinearLayout&gt; </code></pre> <p><strong>activity</strong></p> <pre><code> package com.app.app.hello; import android.app.Activity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.view.View.OnClickListener; import android.widget.BaseAdapter; import android.widget.Button; import android.widget.ListView; public class HelloActivity extends Activity { ListView llList; Button btn2,btn1; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); llList=(ListView) findViewById(R.id.llList); llList.setVisibility(View.GONE); myAdapter adapter=new myAdapter(); llList.setAdapter(adapter); btn2=(Button) findViewById(R.id.button); Button btn1=(Button) findViewById(R.id.Button01); btn1.setOnClickListener(new OnClickListener() { public void onClick(View v) { llList.setVisibility(View.VISIBLE); } }); } class myAdapter extends BaseAdapter { public int getCount() { // TODO Auto-generated method stub return 5; } public Object getItem(int position) { // TODO Auto-generated method stub return position; } public long getItemId(int position) { // TODO Auto-generated method stub return position; } public View getView(int position, View convertView, ViewGroup parent) { View row=View.inflate(HelloActivity.this,R.layout.list_row, null); // TODO Auto-generated method stub return row; } } } </code></pre> <p><img src="https://i.stack.imgur.com/DlYZc.png" alt="enter image description here"></p>
    singulars
    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.
 

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