问:
To get data in listview
When i click on view button it shows 4 fields in listview-Sr,Item,Qty,Prize.
I am able to get data in Listview but problem is that when i increment 3 times it shows all value of incrementation.Suppose for 1 item price is 5.It shows
1-5,2-10,3-15.But i directly want to show 3-15 if it is incremented 3 times.I have added xml too.Thanks for help in advance.
Following is my code-

```MainActivity.java

    import android.app.Activity;
    import android.content.Intent;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.support.v7.widget.SearchView;
    import android.text.TextUtils;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.ArrayAdapter;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.ListAdapter;
    import android.widget.ListView;
    import android.widget.Toast;
    import java.util.ArrayList;

    public class MainActivity extends Activity {

    Button show;
        ListView list_item;
        private ArrayList<Integer> sr;
        private ArrayList<String> item;
        private ArrayList<Integer> quantity;
        private ArrayList<Integer> price;

        private ArrayList<Integer> sr1;
        private ArrayList<String> item1;
        private ArrayList<Integer> price1;
        private ArrayList<Integer> data1;
        SearchView searchView;
        private ArrayList<String> filterlist;
        public Custom custom;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            list_item = (ListView) findViewById(R.id.listdetails);

            show=(Button)findViewById(R.id.btnview);
            sr = new ArrayList<>();
            item = new ArrayList<>();
            quantity = new ArrayList<>();
            price = new ArrayList<>();

            sr1 = new ArrayList<>();
            item1 = new ArrayList<>();
            data1= new ArrayList<>();
            price1= new ArrayList<>();

            filterlist = new ArrayList<>();
            item = filterlist;

            sr.add(1);
            sr.add(2);
            sr.add(3);
            sr.add(4);

            item.add("Book");
            item.add("pen");
            item.add("pencil");
            item.add("Eraser");

            quantity.add(0);
            quantity.add(0);
            quantity.add(0);
            quantity.add(0);

            price.add(20);
            price.add(30);
            price.add(5);
            price.add(5);

            Custom c = new Custom(this, sr, item, quantity, price,sr1,item1,data1,price1);
            list_item.setAdapter(c);

            show.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(MainActivity.this,Trial.class);
                    intent.putExtra("sr",sr1);
                    intent.putExtra("item",item1);
                    intent.putExtra("qty",data1);
                    intent.putExtra("price",price1);
                    startActivity(intent);
                }
            });

        }

    }

    Custom.java

    import android.app.Activity;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.Button;
    import android.widget.Filter;
    import android.widget.Filterable;
    import android.widget.TextView;

    import java.util.ArrayList;

    public class Custom  extends BaseAdapter {

        Activity a;
        public ArrayList<Integer> sr;
        public ArrayList<String> item;
        public ArrayList<Integer> quantity;
        public ArrayList<Integer> price;

        public ArrayList<Integer> sr1;
        public ArrayList<String> item1;
        public ArrayList<Integer> data1;
        public ArrayList<Integer> price1;
        public ArrayList<String> filterlist;

        int bookCount = 0;
        int penCount = 0;
        int pencilCount = 0;
        int eraserCount=0;

        int bookPrice = 0;
        int penPrice = 0;
        int pencilPrice = 0;
        int eraserPrice=0;

        private String data, pricedata;

        public Custom(Activity a, ArrayList<Integer> sr, ArrayList<String> item, ArrayList<Integer> quantity, ArrayList<Integer> price, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data1, ArrayList<Integer> price1) {
            this.a = a;
            this.sr = sr;
            this.item = item;
            this.quantity = quantity;
            this.price = price;
            this.sr1 = sr1;
            this.item1 = item1;
            this.data1 = data1;
            this.price1 = price1;
        }

        @Override
        public int getCount() {
            return item.size();
        }

        @Override
        public Object getItem(int position) {
            return item.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        public class Holder{
            TextView sr1,item1,qty1,price1;
            Button pl,min;

        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            final Holder holder=new Holder();
            LayoutInflater li=a.getLayoutInflater();
            final View view=li.inflate(R.layout.customlist,parent,false);

            holder.sr1=(TextView)view.findViewById(R.id.s_no);
            holder.item1=(TextView)view.findViewById(R.id.i_name);
            holder.qty1=(TextView)view.findViewById(R.id.qty);
            holder.price1=(TextView)view.findViewById(R.id.pr);
            holder.pl=(Button) view.findViewById(R.id.pl);
            holder.min=(Button)view.findViewById(R.id.min);

            holder.sr1.setText(String.valueOf(sr.get(position)));
            holder.item1.setText(item.get(position));
            holder.qty1.setText(String.valueOf(quantity.get(position)));
            holder.price1.setText(String.valueOf(price.get(position)));

            holder.pl.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    switch (position) {
                        case 0:
                            if (bookCount >= 0) {
                                bookCount++;
                                bookPrice = bookPrice + 20;
                                sr.get(position);
                                item.get(position);

                            }
                            break;

                        case 1:
                            if (penCount >= 0) {
                                penCount++;
                                penPrice += 30;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 2:
                            if (pencilCount >= 0) {
                                pencilCount++;
                                pencilPrice += 5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 3:
                            if(eraserCount>=0){
                                eraserCount++;
                                eraserPrice +=5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                    }
                  if(position==0)
                  {
                      holder.qty1.setText(String.valueOf(bookCount));
                      holder.price1.setText(String.valueOf(bookPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(bookCount);
                      price1.add(bookPrice);
                  }
                    else if(position==1)
                  {
                      holder.qty1.setText(String.valueOf(penCount));
                      holder.price1.setText(String.valueOf(penPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(penCount);
                      price1.add(penPrice);
                  }
                    else if(position==2)
                  {
                      holder.qty1.setText(String.valueOf(pencilCount));
                      holder.price1.setText(String.valueOf(pencilPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(pencilCount);
                      price1.add(pencilPrice);
                  }
                    else if(position==3)
                  {
                      holder.qty1.setText(String.valueOf(eraserCount));
                      holder.price1.setText(String.valueOf(eraserPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(eraserCount);
                      price1.add(eraserPrice);

                  }

                }
            });

            holder.min.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    switch (position) {
                        case 0:
                            if (bookCount > 0) {
                                bookCount--;
                                bookPrice -= 20;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 1:
                            if (penCount > 0) {
                                penCount--;
                                penPrice -= 30;

                                sr.get(position);
                                item.get(position);

                            }
                            break;

                        case 2:
                            if (pencilCount > 0) {
                                pencilCount--;
                                pencilPrice -= 5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 3:
                            if(eraserCount > 0){
                                eraserCount--;
                                eraserPrice-=5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                    }

                    if(position==0)
                    {
                        holder.qty1.setText(String.valueOf(bookCount));
                        holder.price1.setText(String.valueOf(bookPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(bookCount);
                        price1.add(bookPrice);
                    }
                    else if(position==1)
                    {
                        holder.qty1.setText(String.valueOf(penCount));
                        holder.price1.setText(String.valueOf(penPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(penCount);
                        price1.add(penPrice);
                    }
                    else if(position==2)
                    {
                        holder.qty1.setText(String.valueOf(pencilCount));
                        holder.price1.setText(String.valueOf(pencilPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(pencilCount);
                        price1.add(pencilPrice);
                    }
                    else if(position==3)
                    {
                        holder.qty1.setText(String.valueOf(eraserCount));
                        holder.price1.setText(String.valueOf(eraserPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(eraserCount);
                        price1.add(eraserPrice);

                    }

                }
            });

            return view;

        }

    }

    Trial.java
    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.ListView;
    import android.widget.TextView;

    import java.util.ArrayList;

    public class Trial extends Activity {
        ListView listnew;

        ArrayList<Integer> sr1;
        ArrayList<String> item1;
        ArrayList<Integer> data;
        ArrayList<Integer> price;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.trial);
            data=new ArrayList<>();
            price=new ArrayList<>();
            listnew=(ListView)findViewById(R.id.newlist);

            Bundle bundle=getIntent().getExtras();
            sr1=bundle.getIntegerArrayList("sr");
            item1=bundle.getStringArrayList("item");
            data=bundle.getIntegerArrayList("qty");
            price=bundle.getIntegerArrayList("price");

            Custom_Trial ct=new Custom_Trial(this,sr1,item1,data,price);
            listnew.setAdapter(ct);

        }
    }

    CustomTrial.java
    package com.example.ram.logic;
    import android.app.Activity;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.TextView;

    import java.util.ArrayList;

    public class Custom_Trial extends BaseAdapter {
        Activity a;

        ArrayList<Integer> sr1;
        ArrayList<String> item1;
        ArrayList<Integer> data;
        ArrayList<Integer> price;

        public Custom_Trial(Activity a, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data, ArrayList<Integer> price) {
            this.a = a;
            this.sr1 = sr1;
            this.item1 = item1;
            this.data = data;
            this.price = price;
        }

        @Override
        public int getCount() {
            return data.size();
        }

        @Override
        public Object getItem(int position) {
            return data.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }
        public class Holder{
            TextView sr,it,qty,amt;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            Holder holder=new Holder();
            LayoutInflater li=a.getLayoutInflater();
            View view=li.inflate(R.layout.customtrial,parent,false);
            holder.sr=(TextView)view.findViewById(R.id.head1);
            holder.it=(TextView)view.findViewById(R.id.head2);
            holder.qty=(TextView)view.findViewById(R.id.head3);
            holder.amt=(TextView)view.findViewById(R.id.head4);

            holder.sr.setText(String.valueOf(sr1.get(position)));
            holder.it.setText(item1.get(position));
            holder.qty.setText(String.valueOf(data.get(position)));
            holder.amt.setText(String.valueOf(price.get(position)));

            return view;
        }
    }

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.abc.logic.MainActivity">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/item_name"
        android:orientation="horizontal"
        android:layout_toRightOf="@+id/sr_no"

        >
        <TextView
            android:layout_width="150dp"
            android:layout_height="50dp"
            android:layout_toRightOf="@+id/srno"
            android:layout_below="@+id/breakfast"
            android:text="ITEM NAME"
            android:id="@+id/itemname"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            />

    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/qtity"
        android:orientation="horizontal"
        android:layout_toRightOf="@+id/item_name"

        >
        <TextView
            android:layout_width="40dp"
            android:layout_height="50dp"
            android:layout_toRightOf="@+id/itemname"
            android:layout_below="@+id/lunch"
            android:text="QTY"
            android:id="@+id/quantity"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            />

    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/count"
        android:layout_toRightOf="@+id/qtity"

        >
        <TextView
            android:layout_width="50dp"
            android:layout_height="50dp" />

    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/rate"
        android:orientation="horizontal"
        android:layout_toRightOf="@+id/count"

        >
        <TextView
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_toRightOf="@+id/quantity"
            android:layout_below="@+id/snacks"
            android:text="PRICE"
            android:id="@+id/price"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            />

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/sr_no"
        android:orientation="horizontal"

        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">
        <TextView
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_below="@+id/breakfast"
            android:layout_margin="2dp"
            android:layout_marginTop="10dp"
            android:text="SR.NO"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            android:id="@+id/srno"
            />

    </LinearLayout>

    <ListView
        android:layout_width="match_parent"
        android:layout_height="350dp"
        android:id="@+id/listdetails"
        android:scrollbars="vertical"
        android:layout_below="@+id/item_name"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

    </ListView>

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/btnview"
        android:text="View"
        android:layout_below="@+id/listdetails"
        android:clickable="true">

    </Button>

</RelativeLayout>

customlist.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:id="@+id/s_no"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        />
    <TextView
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        android:id="@+id/i_name"
        android:layout_marginTop="5dp"
        android:layout_toRightOf="@+id/s_no"
        />

    <Button
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:id="@+id/pl"
        android:layout_marginTop="5dp"
        android:layout_toRightOf="@+id/qty"
        android:background="@drawable/plus1"
        />
    <TextView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:id="@+id/qty"
        android:layout_toRightOf="@id/i_name"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        android:layout_marginTop="5dp"
        />

    <Button
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:id="@+id/min"
        android:layout_marginTop="3dp"
        android:layout_below="@id/pl"
        android:layout_toRightOf="@id/qty"
        android:background="@drawable/minus1"
        />

    <TextView
        android:layout_width="60dp"
        android:layout_height="50dp"
        android:id="@+id/pr"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        android:layout_marginLeft="10dp"
        android:layout_alignBottom="@+id/min"
        android:layout_toRightOf="@+id/pl"
        android:layout_toEndOf="@+id/pl" />

</RelativeLayout>

customtrial.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head1"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="20dp"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head2"
        android:layout_toRightOf="@+id/head1"
        android:textSize="20dp"
        android:gravity="center"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head3"
        android:layout_toRightOf="@+id/head2"
        android:textSize="20dp"
        android:gravity="center"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head4"
        android:layout_toRightOf="@+id/head3"
        android:textSize="20dp"
        android:gravity="center"
        />
</RelativeLayout>

trial.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head1"
        android:text="SrNo"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="20dp"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head2"
        android:layout_toRightOf="@+id/head1"
        android:textSize="20dp"
        android:gravity="center"
        android:text="Item"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head3"
        android:text="Qty"
        android:layout_toRightOf="@+id/head2"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="20dp"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head4"
        android:layout_toRightOf="@+id/head3"
        android:textSize="20dp"
        android:gravity="center"
        android:text="Price"
        />

    <ListView
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:id="@+id/newlist"
        android:scrollbars="vertical"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/head1"

        >

    </ListView>

</RelativeLayout>
```

答:
You have to make the changes on your CustomAdapter here is code without the model class:

```<code>        import android.app.Activity;
        import android.content.Intent;
        import android.os.Bundle;
        import android.support.v7.widget.SearchView;
        import android.view.View;
        import android.widget.Button;
        import android.widget.ListView;

        import java.util.ArrayList;
        import java.util.LinkedHashSet;
        import java.util.Set;

        import android.view.LayoutInflater;
        import android.view.ViewGroup;
        import android.widget.BaseAdapter;
        import android.widget.TextView;

        public class MainActivityList extends Activity {

            Button show;
            ListView list_item;
            private ArrayList<Integer> sr;
            private ArrayList<String> item;
            private ArrayList<Integer> quantity;
            private ArrayList<Integer> price;

            private ArrayList<Integer> sr1;
            private ArrayList<String> item1;
            private ArrayList<Integer> price1;
            private ArrayList<Integer> data1;
            SearchView searchView;
            private ArrayList<String> filterlist;
            public Custom custom;

            int bookCount = 0;
            int penCount = 0;
            int pencilCount = 0;
            int eraserCount=0;

            int bookPrice = 0;
            int penPrice = 0;
            int pencilPrice = 0;
            int eraserPrice=0;

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main_list);

                list_item = (ListView) findViewById(R.id.listdetails);

                show=(Button)findViewById(R.id.btnview);
                sr = new ArrayList<>();
                item = new ArrayList<>();
                quantity = new ArrayList<>();
                price = new ArrayList<>();

                sr1 = new ArrayList<>();
                item1 = new ArrayList<>();
                data1= new ArrayList<>();
                price1= new ArrayList<>();

                filterlist = new ArrayList<>();
                item = filterlist;

                sr.add(1);
                sr.add(2);
                sr.add(3);
                sr.add(4);

                item.add("Book");
                item.add("pen");
                item.add("pencil");
                item.add("Eraser");

                quantity.add(0);
                quantity.add(0);
                quantity.add(0);
                quantity.add(0);

                price.add(20);
                price.add(30);
                price.add(5);
                price.add(5);

                Custom c = new Custom(this, sr, item, quantity, price,sr1,item1,data1,price1);
                list_item.setAdapter(c);

                show.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent=new Intent(MainActivityList.this,Trial.class);
                        Set<Integer> s = new LinkedHashSet<>();
                        s.addAll(sr);
                        sr.clear();
                        sr.addAll(s);

                        Set<String> ss = new LinkedHashSet<>();
                        ss.addAll(item);
                        item.clear();
                        item.addAll(ss);

                        data1.clear();
                        price1.clear();

                        for(Integer srn: sr){
                            if(srn==1){
                                data1.add(bookCount);
                                price1.add(bookPrice);
                            }

                            if(srn==2){
                                data1.add(penCount);
                                price1.add(penPrice);
                            }

                            if(srn==3){
                                data1.add(pencilCount);
                                price1.add(pencilPrice);
                            }

                            if(srn==4){
                                data1.add(eraserCount);
                                price1.add(eraserPrice);
                            }
                        }

                        intent.putExtra("sr",sr);
                        intent.putExtra("item",item);
                        intent.putExtra("qty",data1);
                        intent.putExtra("price",price1);
                        startActivity(intent);
                    }
                });

            }

            public class Custom  extends BaseAdapter {

                Activity a;
                public ArrayList<Integer> sr;
                public ArrayList<String> item;
                public ArrayList<Integer> quantity;
                public ArrayList<Integer> price;

                public ArrayList<Integer> sr1;
                public ArrayList<String> item1;
                public ArrayList<Integer> data1;
                public ArrayList<Integer> price1;
                public ArrayList<String> filterlist;

                private String data, pricedata;

                public Custom(Activity a, ArrayList<Integer> sr, ArrayList<String> item, ArrayList<Integer> quantity, ArrayList<Integer> price, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data1, ArrayList<Integer> price1) {
                    this.a = a;
                    this.sr = sr;
                    this.item = item;
                    this.quantity = quantity;
                    this.price = price;
                    this.sr1 = sr1;
                    this.item1 = item1;
                    this.data1 = data1;
                    this.price1 = price1;
                }

                @Override
                public int getCount() {
                    return item.size();
                }

                @Override
                public Object getItem(int position) {
                    return item.get(position);
                }

                @Override
                public long getItemId(int position) {
                    return position;
                }

                public class Holder{
                    TextView sr1,item1,qty1,price1;
                    Button pl,min;

                }

                @Override
                public View getView(final int position, View convertView, ViewGroup parent) {
                    final Holder holder=new Holder();
                    LayoutInflater li=a.getLayoutInflater();
                    final View view=li.inflate(R.layout.customlist,parent,false);

                    holder.sr1=(TextView)view.findViewById(R.id.s_no);
                    holder.item1=(TextView)view.findViewById(R.id.i_name);
                    holder.qty1=(TextView)view.findViewById(R.id.qty);
                    holder.price1=(TextView)view.findViewById(R.id.pr);
                    holder.pl=(Button) view.findViewById(R.id.pl);
                    holder.min=(Button)view.findViewById(R.id.min);

                    holder.sr1.setText(String.valueOf(sr.get(position)));
                    holder.item1.setText(item.get(position));
                    holder.qty1.setText(String.valueOf(quantity.get(position)));
                    holder.price1.setText(String.valueOf(price.get(position)));

                    holder.pl.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            switch (position) {
                                case 0:
                                    if (bookCount >= 0) {
                                        bookCount++;
                                        bookPrice = bookPrice + 20;
                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;

                                case 1:
                                    if (penCount >= 0) {
                                        penCount++;
                                        penPrice += 30;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 2:
                                    if (pencilCount >= 0) {
                                        pencilCount++;
                                        pencilPrice += 5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 3:
                                    if(eraserCount>=0){
                                        eraserCount++;
                                        eraserPrice +=5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                            }
                            if(position==0)
                            {
                                holder.qty1.setText(String.valueOf(bookCount));
                                holder.price1.setText(String.valueOf(bookPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(bookCount);
                                price1.add(bookPrice);
                            }
                            else if(position==1)
                            {
                                holder.qty1.setText(String.valueOf(penCount));
                                holder.price1.setText(String.valueOf(penPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(penCount);
                                price1.add(penPrice);
                            }
                            else if(position==2)
                            {
                                holder.qty1.setText(String.valueOf(pencilCount));
                                holder.price1.setText(String.valueOf(pencilPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(pencilCount);
                                price1.add(pencilPrice);
                            }
                            else if(position==3)
                            {
                                holder.qty1.setText(String.valueOf(eraserCount));
                                holder.price1.setText(String.valueOf(eraserPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(eraserCount);
                                price1.add(eraserPrice);

                            }

                        }
                    });

                    holder.min.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {

                            switch (position) {
                                case 0:
                                    if (bookCount > 0) {
                                        bookCount--;
                                        bookPrice -= 20;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 1:
                                    if (penCount > 0) {
                                        penCount--;
                                        penPrice -= 30;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;

                                case 2:
                                    if (pencilCount > 0) {
                                        pencilCount--;
                                        pencilPrice -= 5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 3:
                                    if(eraserCount > 0){
                                        eraserCount--;
                                        eraserPrice-=5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                            }

                            if(position==0)
                            {
                                holder.qty1.setText(String.valueOf(bookCount));
                                holder.price1.setText(String.valueOf(bookPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(bookCount);
                                price1.add(bookPrice);
                            }
                            else if(position==1)
                            {
                                holder.qty1.setText(String.valueOf(penCount));
                                holder.price1.setText(String.valueOf(penPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(penCount);
                                price1.add(penPrice);
                            }
                            else if(position==2)
                            {
                                holder.qty1.setText(String.valueOf(pencilCount));
                                holder.price1.setText(String.valueOf(pencilPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(pencilCount);
                                price1.add(pencilPrice);
                            }
                            else if(position==3)
                            {
                                holder.qty1.setText(String.valueOf(eraserCount));
                                holder.price1.setText(String.valueOf(eraserPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(eraserCount);
                                price1.add(eraserPrice);

                            }

                        }
                    });

                    return view;

                }

            }

        }
</code>```

Trial Activity:

```<code>package com.demostudies;

        import android.app.Activity;
        import android.os.Bundle;
        import android.view.LayoutInflater;
        import android.view.View;
        import android.view.ViewGroup;
        import android.widget.BaseAdapter;
        import android.widget.ListView;
        import android.widget.TextView;

        import java.util.ArrayList;

        public class Trial extends Activity {
            ListView listnew;

            ArrayList<Integer> sr1;
            ArrayList<String> item1;
            ArrayList<Integer> data;
            ArrayList<Integer> price;

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.trial);
                data = new ArrayList<>();
                price = new ArrayList<>();
                listnew = (ListView) findViewById(R.id.newlist);

                Bundle bundle = getIntent().getExtras();

                sr1 = bundle.getIntegerArrayList("sr");
                item1 = bundle.getStringArrayList("item");
                data = bundle.getIntegerArrayList("qty");
                price = bundle.getIntegerArrayList("price");

                ArrayList<Integer> qty = new ArrayList<>();
                ArrayList<String> name = new ArrayList<>();
                ArrayList<Integer> srn = new ArrayList<>();
                ArrayList<Integer> ps = new ArrayList<>();
                for(int i=0;i<data.size();i++){
                    if(data.get(i)>0){
                        qty.add(data.get(i));
                        name.add(item1.get(i));
                        srn.add(sr1.get(i));
                        ps.add(price.get(i));
                    }
                }

                sr1.clear();
                sr1.addAll(srn);
                item1.clear();
                item1.addAll(name);
                data.clear();
                data.addAll(qty);
                price.clear();
                price.addAll(ps);
                Custom_Trial ct = new Custom_Trial(this, sr1, item1, data, price);

                listnew.setAdapter(ct);

            }

            public class Custom_Trial extends BaseAdapter {
                Activity a;

                ArrayList<Integer> sr1;
                ArrayList<String> item1;
                ArrayList<Integer> data;
                ArrayList<Integer> price;

                public Custom_Trial(Activity a, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data, ArrayList<Integer> price) {
                    this.a = a;
                    this.sr1 = sr1;
                    this.item1 = item1;
                    this.data = data;
                    this.price = price;
                }

                @Override
                public int getCount() {
                    return data.size();
                }

                @Override
                public Object getItem(int position) {
                    return data.get(position);
                }

                @Override
                public long getItemId(int position) {
                    return position;
                }
                public class Holder{
                    TextView sr,it,qty,amt;
                }

                @Override
                public View getView(int position, View convertView, ViewGroup parent) {
                    Holder holder=new Holder();
                    LayoutInflater li=a.getLayoutInflater();
                    View view=li.inflate(R.layout.customtrial,parent,false);
                    holder.sr=(TextView)view.findViewById(R.id.head1);
                    holder.it=(TextView)view.findViewById(R.id.head2);
                    holder.qty=(TextView)view.findViewById(R.id.head3);
                    holder.amt=(TextView)view.findViewById(R.id.head4);

                    holder.sr.setText(String.valueOf(sr1.get(position)));
                    holder.it.setText(item1.get(position));
                    holder.qty.setText(String.valueOf(data.get(position)));
                    holder.amt.setText(String.valueOf(price.get(position)));

                    return view;
                }
            }

        }
</code>```

Title: To get data in listview

Body:
When i click on view button it shows 4 fields in listview-Sr,Item,Qty,Prize.
I am able to get data in Listview but problem is that when i increment 3 times it shows all value of incrementation.Suppose for 1 item price is 5.It shows
1-5,2-10,3-15.But i directly want to show 3-15 if it is incremented 3 times.I have added xml too.Thanks for help in advance.
Following is my code-

MainActivity.java

    import android.app.Activity;
    import android.content.Intent;
    import android.support.v7.app.AppCompatActivity;
    import android.os.Bundle;
    import android.support.v7.widget.SearchView;
    import android.text.TextUtils;
    import android.view.View;
    import android.widget.AdapterView;
    import android.widget.ArrayAdapter;
    import android.widget.Button;
    import android.widget.EditText;
    import android.widget.ListAdapter;
    import android.widget.ListView;
    import android.widget.Toast;
    import java.util.ArrayList;

    public class MainActivity extends Activity {

    Button show;
        ListView list_item;
        private ArrayList<Integer> sr;
        private ArrayList<String> item;
        private ArrayList<Integer> quantity;
        private ArrayList<Integer> price;

        private ArrayList<Integer> sr1;
        private ArrayList<String> item1;
        private ArrayList<Integer> price1;
        private ArrayList<Integer> data1;
        SearchView searchView;
        private ArrayList<String> filterlist;
        public Custom custom;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);

            list_item = (ListView) findViewById(R.id.listdetails);

            show=(Button)findViewById(R.id.btnview);
            sr = new ArrayList<>();
            item = new ArrayList<>();
            quantity = new ArrayList<>();
            price = new ArrayList<>();

            sr1 = new ArrayList<>();
            item1 = new ArrayList<>();
            data1= new ArrayList<>();
            price1= new ArrayList<>();

            filterlist = new ArrayList<>();
            item = filterlist;

            sr.add(1);
            sr.add(2);
            sr.add(3);
            sr.add(4);

            item.add("Book");
            item.add("pen");
            item.add("pencil");
            item.add("Eraser");

            quantity.add(0);
            quantity.add(0);
            quantity.add(0);
            quantity.add(0);

            price.add(20);
            price.add(30);
            price.add(5);
            price.add(5);

            Custom c = new Custom(this, sr, item, quantity, price,sr1,item1,data1,price1);
            list_item.setAdapter(c);

            show.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Intent intent=new Intent(MainActivity.this,Trial.class);
                    intent.putExtra("sr",sr1);
                    intent.putExtra("item",item1);
                    intent.putExtra("qty",data1);
                    intent.putExtra("price",price1);
                    startActivity(intent);
                }
            });

        }

    }

    Custom.java

    import android.app.Activity;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.Button;
    import android.widget.Filter;
    import android.widget.Filterable;
    import android.widget.TextView;

    import java.util.ArrayList;

    public class Custom  extends BaseAdapter {

        Activity a;
        public ArrayList<Integer> sr;
        public ArrayList<String> item;
        public ArrayList<Integer> quantity;
        public ArrayList<Integer> price;

        public ArrayList<Integer> sr1;
        public ArrayList<String> item1;
        public ArrayList<Integer> data1;
        public ArrayList<Integer> price1;
        public ArrayList<String> filterlist;

        int bookCount = 0;
        int penCount = 0;
        int pencilCount = 0;
        int eraserCount=0;

        int bookPrice = 0;
        int penPrice = 0;
        int pencilPrice = 0;
        int eraserPrice=0;

        private String data, pricedata;

        public Custom(Activity a, ArrayList<Integer> sr, ArrayList<String> item, ArrayList<Integer> quantity, ArrayList<Integer> price, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data1, ArrayList<Integer> price1) {
            this.a = a;
            this.sr = sr;
            this.item = item;
            this.quantity = quantity;
            this.price = price;
            this.sr1 = sr1;
            this.item1 = item1;
            this.data1 = data1;
            this.price1 = price1;
        }

        @Override
        public int getCount() {
            return item.size();
        }

        @Override
        public Object getItem(int position) {
            return item.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }

        public class Holder{
            TextView sr1,item1,qty1,price1;
            Button pl,min;

        }

        @Override
        public View getView(final int position, View convertView, ViewGroup parent) {
            final Holder holder=new Holder();
            LayoutInflater li=a.getLayoutInflater();
            final View view=li.inflate(R.layout.customlist,parent,false);

            holder.sr1=(TextView)view.findViewById(R.id.s_no);
            holder.item1=(TextView)view.findViewById(R.id.i_name);
            holder.qty1=(TextView)view.findViewById(R.id.qty);
            holder.price1=(TextView)view.findViewById(R.id.pr);
            holder.pl=(Button) view.findViewById(R.id.pl);
            holder.min=(Button)view.findViewById(R.id.min);

            holder.sr1.setText(String.valueOf(sr.get(position)));
            holder.item1.setText(item.get(position));
            holder.qty1.setText(String.valueOf(quantity.get(position)));
            holder.price1.setText(String.valueOf(price.get(position)));

            holder.pl.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    switch (position) {
                        case 0:
                            if (bookCount >= 0) {
                                bookCount++;
                                bookPrice = bookPrice + 20;
                                sr.get(position);
                                item.get(position);

                            }
                            break;

                        case 1:
                            if (penCount >= 0) {
                                penCount++;
                                penPrice += 30;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 2:
                            if (pencilCount >= 0) {
                                pencilCount++;
                                pencilPrice += 5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 3:
                            if(eraserCount>=0){
                                eraserCount++;
                                eraserPrice +=5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                    }
                  if(position==0)
                  {
                      holder.qty1.setText(String.valueOf(bookCount));
                      holder.price1.setText(String.valueOf(bookPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(bookCount);
                      price1.add(bookPrice);
                  }
                    else if(position==1)
                  {
                      holder.qty1.setText(String.valueOf(penCount));
                      holder.price1.setText(String.valueOf(penPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(penCount);
                      price1.add(penPrice);
                  }
                    else if(position==2)
                  {
                      holder.qty1.setText(String.valueOf(pencilCount));
                      holder.price1.setText(String.valueOf(pencilPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(pencilCount);
                      price1.add(pencilPrice);
                  }
                    else if(position==3)
                  {
                      holder.qty1.setText(String.valueOf(eraserCount));
                      holder.price1.setText(String.valueOf(eraserPrice));

                      sr1.add(sr.get(position));
                      item1.add(item.get(position));
                      data1.add(eraserCount);
                      price1.add(eraserPrice);

                  }

                }
            });

            holder.min.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {

                    switch (position) {
                        case 0:
                            if (bookCount > 0) {
                                bookCount--;
                                bookPrice -= 20;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 1:
                            if (penCount > 0) {
                                penCount--;
                                penPrice -= 30;

                                sr.get(position);
                                item.get(position);

                            }
                            break;

                        case 2:
                            if (pencilCount > 0) {
                                pencilCount--;
                                pencilPrice -= 5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                        case 3:
                            if(eraserCount > 0){
                                eraserCount--;
                                eraserPrice-=5;

                                sr.get(position);
                                item.get(position);

                            }
                            break;
                    }

                    if(position==0)
                    {
                        holder.qty1.setText(String.valueOf(bookCount));
                        holder.price1.setText(String.valueOf(bookPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(bookCount);
                        price1.add(bookPrice);
                    }
                    else if(position==1)
                    {
                        holder.qty1.setText(String.valueOf(penCount));
                        holder.price1.setText(String.valueOf(penPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(penCount);
                        price1.add(penPrice);
                    }
                    else if(position==2)
                    {
                        holder.qty1.setText(String.valueOf(pencilCount));
                        holder.price1.setText(String.valueOf(pencilPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(pencilCount);
                        price1.add(pencilPrice);
                    }
                    else if(position==3)
                    {
                        holder.qty1.setText(String.valueOf(eraserCount));
                        holder.price1.setText(String.valueOf(eraserPrice));

                        sr1.add(sr.get(position));
                        item1.add(item.get(position));
                        data1.add(eraserCount);
                        price1.add(eraserPrice);

                    }

                }
            });

            return view;

        }

    }

    Trial.java
    import android.app.Activity;
    import android.os.Bundle;
    import android.widget.ListView;
    import android.widget.TextView;

    import java.util.ArrayList;

    public class Trial extends Activity {
        ListView listnew;

        ArrayList<Integer> sr1;
        ArrayList<String> item1;
        ArrayList<Integer> data;
        ArrayList<Integer> price;

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.trial);
            data=new ArrayList<>();
            price=new ArrayList<>();
            listnew=(ListView)findViewById(R.id.newlist);

            Bundle bundle=getIntent().getExtras();
            sr1=bundle.getIntegerArrayList("sr");
            item1=bundle.getStringArrayList("item");
            data=bundle.getIntegerArrayList("qty");
            price=bundle.getIntegerArrayList("price");

            Custom_Trial ct=new Custom_Trial(this,sr1,item1,data,price);
            listnew.setAdapter(ct);

        }
    }

    CustomTrial.java
    package com.example.ram.logic;
    import android.app.Activity;
    import android.view.LayoutInflater;
    import android.view.View;
    import android.view.ViewGroup;
    import android.widget.BaseAdapter;
    import android.widget.TextView;

    import java.util.ArrayList;

    public class Custom_Trial extends BaseAdapter {
        Activity a;

        ArrayList<Integer> sr1;
        ArrayList<String> item1;
        ArrayList<Integer> data;
        ArrayList<Integer> price;

        public Custom_Trial(Activity a, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data, ArrayList<Integer> price) {
            this.a = a;
            this.sr1 = sr1;
            this.item1 = item1;
            this.data = data;
            this.price = price;
        }

        @Override
        public int getCount() {
            return data.size();
        }

        @Override
        public Object getItem(int position) {
            return data.get(position);
        }

        @Override
        public long getItemId(int position) {
            return position;
        }
        public class Holder{
            TextView sr,it,qty,amt;
        }

        @Override
        public View getView(int position, View convertView, ViewGroup parent) {
            Holder holder=new Holder();
            LayoutInflater li=a.getLayoutInflater();
            View view=li.inflate(R.layout.customtrial,parent,false);
            holder.sr=(TextView)view.findViewById(R.id.head1);
            holder.it=(TextView)view.findViewById(R.id.head2);
            holder.qty=(TextView)view.findViewById(R.id.head3);
            holder.amt=(TextView)view.findViewById(R.id.head4);

            holder.sr.setText(String.valueOf(sr1.get(position)));
            holder.it.setText(item1.get(position));
            holder.qty.setText(String.valueOf(data.get(position)));
            holder.amt.setText(String.valueOf(price.get(position)));

            return view;
        }
    }

activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="com.example.abc.logic.MainActivity">

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/item_name"
        android:orientation="horizontal"
        android:layout_toRightOf="@+id/sr_no"

        >
        <TextView
            android:layout_width="150dp"
            android:layout_height="50dp"
            android:layout_toRightOf="@+id/srno"
            android:layout_below="@+id/breakfast"
            android:text="ITEM NAME"
            android:id="@+id/itemname"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            />

    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/qtity"
        android:orientation="horizontal"
        android:layout_toRightOf="@+id/item_name"

        >
        <TextView
            android:layout_width="40dp"
            android:layout_height="50dp"
            android:layout_toRightOf="@+id/itemname"
            android:layout_below="@+id/lunch"
            android:text="QTY"
            android:id="@+id/quantity"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            />

    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/count"
        android:layout_toRightOf="@+id/qtity"

        >
        <TextView
            android:layout_width="50dp"
            android:layout_height="50dp" />

    </LinearLayout>
    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/rate"
        android:orientation="horizontal"
        android:layout_toRightOf="@+id/count"

        >
        <TextView
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_toRightOf="@+id/quantity"
            android:layout_below="@+id/snacks"
            android:text="PRICE"
            android:id="@+id/price"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            />

    </LinearLayout>

    <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/sr_no"
        android:orientation="horizontal"

        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">
        <TextView
            android:layout_width="50dp"
            android:layout_height="50dp"
            android:layout_below="@+id/breakfast"
            android:layout_margin="2dp"
            android:layout_marginTop="10dp"
            android:text="SR.NO"
            android:gravity="center"
            android:textStyle="bold"
            android:textColor="#000"
            android:id="@+id/srno"
            />

    </LinearLayout>

    <ListView
        android:layout_width="match_parent"
        android:layout_height="350dp"
        android:id="@+id/listdetails"
        android:scrollbars="vertical"
        android:layout_below="@+id/item_name"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true">

    </ListView>

    <Button
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/btnview"
        android:text="View"
        android:layout_below="@+id/listdetails"
        android:clickable="true">

    </Button>

</RelativeLayout>

customlist.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:id="@+id/s_no"
        android:layout_marginTop="5dp"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        />
    <TextView
        android:layout_width="150dp"
        android:layout_height="50dp"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        android:id="@+id/i_name"
        android:layout_marginTop="5dp"
        android:layout_toRightOf="@+id/s_no"
        />

    <Button
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:id="@+id/pl"
        android:layout_marginTop="5dp"
        android:layout_toRightOf="@+id/qty"
        android:background="@drawable/plus1"
        />
    <TextView
        android:layout_width="50dp"
        android:layout_height="50dp"
        android:id="@+id/qty"
        android:layout_toRightOf="@id/i_name"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        android:layout_marginTop="5dp"
        />

    <Button
        android:layout_width="25dp"
        android:layout_height="25dp"
        android:id="@+id/min"
        android:layout_marginTop="3dp"
        android:layout_below="@id/pl"
        android:layout_toRightOf="@id/qty"
        android:background="@drawable/minus1"
        />

    <TextView
        android:layout_width="60dp"
        android:layout_height="50dp"
        android:id="@+id/pr"
        android:gravity="center"
        android:textColor="#000"
        android:textStyle="bold"
        android:layout_marginLeft="10dp"
        android:layout_alignBottom="@+id/min"
        android:layout_toRightOf="@+id/pl"
        android:layout_toEndOf="@+id/pl" />

</RelativeLayout>

customtrial.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head1"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="20dp"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head2"
        android:layout_toRightOf="@+id/head1"
        android:textSize="20dp"
        android:gravity="center"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head3"
        android:layout_toRightOf="@+id/head2"
        android:textSize="20dp"
        android:gravity="center"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head4"
        android:layout_toRightOf="@+id/head3"
        android:textSize="20dp"
        android:gravity="center"
        />
</RelativeLayout>

trial.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent">

    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head1"
        android:text="SrNo"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="20dp"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head2"
        android:layout_toRightOf="@+id/head1"
        android:textSize="20dp"
        android:gravity="center"
        android:text="Item"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head3"
        android:text="Qty"
        android:layout_toRightOf="@+id/head2"
        android:paddingLeft="10dp"
        android:gravity="center"
        android:textSize="20dp"
        />
    <TextView
        android:layout_width="100dp"
        android:layout_height="40dp"
        android:id="@+id/head4"
        android:layout_toRightOf="@+id/head3"
        android:textSize="20dp"
        android:gravity="center"
        android:text="Price"
        />

    <ListView
        android:layout_width="match_parent"
        android:layout_height="300dp"
        android:id="@+id/newlist"
        android:scrollbars="vertical"
        android:layout_marginTop="10dp"
        android:layout_below="@+id/head1"

        >

    </ListView>

</RelativeLayout>

Body:
You have to make the changes on your CustomAdapter here is code without the model class:

        import android.app.Activity;
        import android.content.Intent;
        import android.os.Bundle;
        import android.support.v7.widget.SearchView;
        import android.view.View;
        import android.widget.Button;
        import android.widget.ListView;

        import java.util.ArrayList;
        import java.util.LinkedHashSet;
        import java.util.Set;

        import android.view.LayoutInflater;
        import android.view.ViewGroup;
        import android.widget.BaseAdapter;
        import android.widget.TextView;

        public class MainActivityList extends Activity {

            Button show;
            ListView list_item;
            private ArrayList<Integer> sr;
            private ArrayList<String> item;
            private ArrayList<Integer> quantity;
            private ArrayList<Integer> price;

            private ArrayList<Integer> sr1;
            private ArrayList<String> item1;
            private ArrayList<Integer> price1;
            private ArrayList<Integer> data1;
            SearchView searchView;
            private ArrayList<String> filterlist;
            public Custom custom;

            int bookCount = 0;
            int penCount = 0;
            int pencilCount = 0;
            int eraserCount=0;

            int bookPrice = 0;
            int penPrice = 0;
            int pencilPrice = 0;
            int eraserPrice=0;

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.activity_main_list);

                list_item = (ListView) findViewById(R.id.listdetails);

                show=(Button)findViewById(R.id.btnview);
                sr = new ArrayList<>();
                item = new ArrayList<>();
                quantity = new ArrayList<>();
                price = new ArrayList<>();

                sr1 = new ArrayList<>();
                item1 = new ArrayList<>();
                data1= new ArrayList<>();
                price1= new ArrayList<>();

                filterlist = new ArrayList<>();
                item = filterlist;

                sr.add(1);
                sr.add(2);
                sr.add(3);
                sr.add(4);

                item.add("Book");
                item.add("pen");
                item.add("pencil");
                item.add("Eraser");

                quantity.add(0);
                quantity.add(0);
                quantity.add(0);
                quantity.add(0);

                price.add(20);
                price.add(30);
                price.add(5);
                price.add(5);

                Custom c = new Custom(this, sr, item, quantity, price,sr1,item1,data1,price1);
                list_item.setAdapter(c);

                show.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        Intent intent=new Intent(MainActivityList.this,Trial.class);
                        Set<Integer> s = new LinkedHashSet<>();
                        s.addAll(sr);
                        sr.clear();
                        sr.addAll(s);

                        Set<String> ss = new LinkedHashSet<>();
                        ss.addAll(item);
                        item.clear();
                        item.addAll(ss);

                        data1.clear();
                        price1.clear();

                        for(Integer srn: sr){
                            if(srn==1){
                                data1.add(bookCount);
                                price1.add(bookPrice);
                            }

                            if(srn==2){
                                data1.add(penCount);
                                price1.add(penPrice);
                            }

                            if(srn==3){
                                data1.add(pencilCount);
                                price1.add(pencilPrice);
                            }

                            if(srn==4){
                                data1.add(eraserCount);
                                price1.add(eraserPrice);
                            }
                        }

                        intent.putExtra("sr",sr);
                        intent.putExtra("item",item);
                        intent.putExtra("qty",data1);
                        intent.putExtra("price",price1);
                        startActivity(intent);
                    }
                });

            }

            public class Custom  extends BaseAdapter {

                Activity a;
                public ArrayList<Integer> sr;
                public ArrayList<String> item;
                public ArrayList<Integer> quantity;
                public ArrayList<Integer> price;

                public ArrayList<Integer> sr1;
                public ArrayList<String> item1;
                public ArrayList<Integer> data1;
                public ArrayList<Integer> price1;
                public ArrayList<String> filterlist;

                private String data, pricedata;

                public Custom(Activity a, ArrayList<Integer> sr, ArrayList<String> item, ArrayList<Integer> quantity, ArrayList<Integer> price, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data1, ArrayList<Integer> price1) {
                    this.a = a;
                    this.sr = sr;
                    this.item = item;
                    this.quantity = quantity;
                    this.price = price;
                    this.sr1 = sr1;
                    this.item1 = item1;
                    this.data1 = data1;
                    this.price1 = price1;
                }

                @Override
                public int getCount() {
                    return item.size();
                }

                @Override
                public Object getItem(int position) {
                    return item.get(position);
                }

                @Override
                public long getItemId(int position) {
                    return position;
                }

                public class Holder{
                    TextView sr1,item1,qty1,price1;
                    Button pl,min;

                }

                @Override
                public View getView(final int position, View convertView, ViewGroup parent) {
                    final Holder holder=new Holder();
                    LayoutInflater li=a.getLayoutInflater();
                    final View view=li.inflate(R.layout.customlist,parent,false);

                    holder.sr1=(TextView)view.findViewById(R.id.s_no);
                    holder.item1=(TextView)view.findViewById(R.id.i_name);
                    holder.qty1=(TextView)view.findViewById(R.id.qty);
                    holder.price1=(TextView)view.findViewById(R.id.pr);
                    holder.pl=(Button) view.findViewById(R.id.pl);
                    holder.min=(Button)view.findViewById(R.id.min);

                    holder.sr1.setText(String.valueOf(sr.get(position)));
                    holder.item1.setText(item.get(position));
                    holder.qty1.setText(String.valueOf(quantity.get(position)));
                    holder.price1.setText(String.valueOf(price.get(position)));

                    holder.pl.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {
                            switch (position) {
                                case 0:
                                    if (bookCount >= 0) {
                                        bookCount++;
                                        bookPrice = bookPrice + 20;
                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;

                                case 1:
                                    if (penCount >= 0) {
                                        penCount++;
                                        penPrice += 30;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 2:
                                    if (pencilCount >= 0) {
                                        pencilCount++;
                                        pencilPrice += 5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 3:
                                    if(eraserCount>=0){
                                        eraserCount++;
                                        eraserPrice +=5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                            }
                            if(position==0)
                            {
                                holder.qty1.setText(String.valueOf(bookCount));
                                holder.price1.setText(String.valueOf(bookPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(bookCount);
                                price1.add(bookPrice);
                            }
                            else if(position==1)
                            {
                                holder.qty1.setText(String.valueOf(penCount));
                                holder.price1.setText(String.valueOf(penPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(penCount);
                                price1.add(penPrice);
                            }
                            else if(position==2)
                            {
                                holder.qty1.setText(String.valueOf(pencilCount));
                                holder.price1.setText(String.valueOf(pencilPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(pencilCount);
                                price1.add(pencilPrice);
                            }
                            else if(position==3)
                            {
                                holder.qty1.setText(String.valueOf(eraserCount));
                                holder.price1.setText(String.valueOf(eraserPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(eraserCount);
                                price1.add(eraserPrice);

                            }

                        }
                    });

                    holder.min.setOnClickListener(new View.OnClickListener() {
                        @Override
                        public void onClick(View v) {

                            switch (position) {
                                case 0:
                                    if (bookCount > 0) {
                                        bookCount--;
                                        bookPrice -= 20;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 1:
                                    if (penCount > 0) {
                                        penCount--;
                                        penPrice -= 30;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;

                                case 2:
                                    if (pencilCount > 0) {
                                        pencilCount--;
                                        pencilPrice -= 5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                                case 3:
                                    if(eraserCount > 0){
                                        eraserCount--;
                                        eraserPrice-=5;

                                        sr.get(position);
                                        item.get(position);

                                    }
                                    break;
                            }

                            if(position==0)
                            {
                                holder.qty1.setText(String.valueOf(bookCount));
                                holder.price1.setText(String.valueOf(bookPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(bookCount);
                                price1.add(bookPrice);
                            }
                            else if(position==1)
                            {
                                holder.qty1.setText(String.valueOf(penCount));
                                holder.price1.setText(String.valueOf(penPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(penCount);
                                price1.add(penPrice);
                            }
                            else if(position==2)
                            {
                                holder.qty1.setText(String.valueOf(pencilCount));
                                holder.price1.setText(String.valueOf(pencilPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(pencilCount);
                                price1.add(pencilPrice);
                            }
                            else if(position==3)
                            {
                                holder.qty1.setText(String.valueOf(eraserCount));
                                holder.price1.setText(String.valueOf(eraserPrice));

                                sr1.add(sr.get(position));
                                item1.add(item.get(position));
                                data1.add(eraserCount);
                                price1.add(eraserPrice);

                            }

                        }
                    });

                    return view;

                }

            }

        }

Trial Activity:

package com.demostudies;

        import android.app.Activity;
        import android.os.Bundle;
        import android.view.LayoutInflater;
        import android.view.View;
        import android.view.ViewGroup;
        import android.widget.BaseAdapter;
        import android.widget.ListView;
        import android.widget.TextView;

        import java.util.ArrayList;

        public class Trial extends Activity {
            ListView listnew;

            ArrayList<Integer> sr1;
            ArrayList<String> item1;
            ArrayList<Integer> data;
            ArrayList<Integer> price;

            @Override
            protected void onCreate(Bundle savedInstanceState) {
                super.onCreate(savedInstanceState);
                setContentView(R.layout.trial);
                data = new ArrayList<>();
                price = new ArrayList<>();
                listnew = (ListView) findViewById(R.id.newlist);

                Bundle bundle = getIntent().getExtras();

                sr1 = bundle.getIntegerArrayList("sr");
                item1 = bundle.getStringArrayList("item");
                data = bundle.getIntegerArrayList("qty");
                price = bundle.getIntegerArrayList("price");

                ArrayList<Integer> qty = new ArrayList<>();
                ArrayList<String> name = new ArrayList<>();
                ArrayList<Integer> srn = new ArrayList<>();
                ArrayList<Integer> ps = new ArrayList<>();
                for(int i=0;i<data.size();i++){
                    if(data.get(i)>0){
                        qty.add(data.get(i));
                        name.add(item1.get(i));
                        srn.add(sr1.get(i));
                        ps.add(price.get(i));
                    }
                }

                sr1.clear();
                sr1.addAll(srn);
                item1.clear();
                item1.addAll(name);
                data.clear();
                data.addAll(qty);
                price.clear();
                price.addAll(ps);
                Custom_Trial ct = new Custom_Trial(this, sr1, item1, data, price);

                listnew.setAdapter(ct);

            }

            public class Custom_Trial extends BaseAdapter {
                Activity a;

                ArrayList<Integer> sr1;
                ArrayList<String> item1;
                ArrayList<Integer> data;
                ArrayList<Integer> price;

                public Custom_Trial(Activity a, ArrayList<Integer> sr1, ArrayList<String> item1, ArrayList<Integer> data, ArrayList<Integer> price) {
                    this.a = a;
                    this.sr1 = sr1;
                    this.item1 = item1;
                    this.data = data;
                    this.price = price;
                }

                @Override
                public int getCount() {
                    return data.size();
                }

                @Override
                public Object getItem(int position) {
                    return data.get(position);
                }

                @Override
                public long getItemId(int position) {
                    return position;
                }
                public class Holder{
                    TextView sr,it,qty,amt;
                }

                @Override
                public View getView(int position, View convertView, ViewGroup parent) {
                    Holder holder=new Holder();
                    LayoutInflater li=a.getLayoutInflater();
                    View view=li.inflate(R.layout.customtrial,parent,false);
                    holder.sr=(TextView)view.findViewById(R.id.head1);
                    holder.it=(TextView)view.findViewById(R.id.head2);
                    holder.qty=(TextView)view.findViewById(R.id.head3);
                    holder.amt=(TextView)view.findViewById(R.id.head4);

                    holder.sr.setText(String.valueOf(sr1.get(position)));
                    holder.it.setText(item1.get(position));
                    holder.qty.setText(String.valueOf(data.get(position)));
                    holder.amt.setText(String.valueOf(price.get(position)));

                    return view;
                }
            }

        }


来源: stackexchange

问:
Show Enlarged Image over other Images in a ListBox during MouseOver
I'm trying to create a photo gallery of sorts and i've managed to get images displayed in a nice looking grid but i'm struggling with a specific trigger that transforms the thumbnail and (is supposed to) show the transformed thumbnail over the other images.

Through research i found that changing the ZIndex to a high number should allow the transformed thumbnail to appear over other thumbnails but the transformed thumbnail is still showing under other images.

Code

```<code><Grid>
    <ListBox ItemsSource="{Binding Images, Mode=OneWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock Panel.ZIndex="1000" Grid.Row="1" Text="{Binding Label}" Foreground="White" Width="100" Height="20" TextTrimming="CharacterEllipsis" VerticalAlignment="Center">
                        <TextBlock.Background>
                            <SolidColorBrush Opacity="0.50" Color="Black"/>
                        </TextBlock.Background>
                    </TextBlock>
                    <Border Grid.Row="0" Grid.RowSpan="2" BorderThickness="1" Margin="1" x:Name="border" MouseDown="OnImageViewBorderMouseDown">
                        <Image Source="{Binding Thumbnail, Mode=OneWay}" Height="100" Width="100" />
                        <Border.Style>
                            <Style TargetType="Border">
                                <Setter Property="BorderBrush" Value="Black" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding ElementName=border, Path=IsMouseOver}" Value="True">
                                        <Setter Property="BorderBrush" Value="{DynamicResource AccentColorBrush}"/>
                                        <Setter Property="Grid.ZIndex" Value="1000"/>
                                        <Setter Property="Panel.ZIndex" Value="1000"/>
                                        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
                                        <Setter Property="RenderTransform">
                                            <Setter.Value>
                                                <ScaleTransform ScaleX="1.20" ScaleY="1.20"/>
                                            </Setter.Value>
                                        </Setter>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Border.Style>
                    </Border>
                </Grid>
            </DataTemplate>
        </ListBox.ItemTemplate>
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
    </ListBox>
</Grid>
</code>```

Image of Problem

答:
Setting Panel.ZIndex on the Border element in the ItemTemplate has no effect, because the Border is not a direct child of the WrapPanel in the ItemsPanel.

You should instead apply a Style to the ListBoxItem container element, which is created as child of the ItemsPanel, by setting the ListBox's ItemContainerStyle property:

```<code><ListBox ItemsSource="{Binding Images}">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
    <ListBox.ItemContainerStyle>
        <Style TargetType="ListBoxItem">
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Panel.ZIndex" Value="1000"/>
                    <Setter Property="RenderTransform">
                        <Setter.Value>
                            <ScaleTransform ScaleX="1.20" ScaleY="1.20"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </ListBox.ItemContainerStyle>
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Image Source="{Binding Thumbnail}" Width="100" Height="100"/>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>
</code>```

ContentLicense: CC BY-SA 3.0

Body:
I'm trying to create a photo gallery of sorts and i've managed to get images displayed in a nice looking grid but i'm struggling with a specific trigger that transforms the thumbnail and (is supposed to) show the transformed thumbnail over the other images.

Through research i found that changing the ZIndex to a high number should allow the transformed thumbnail to appear over other thumbnails but the transformed thumbnail is still showing under other images.

Code

<Grid>
    <ListBox ItemsSource="{Binding Images, Mode=OneWay}" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
        <ListBox.ItemTemplate>
            <DataTemplate>
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <TextBlock Panel.ZIndex="1000" Grid.Row="1" Text="{Binding Label}" Foreground="White" Width="100" Height="20" TextTrimming="CharacterEllipsis" VerticalAlignment="Center">
                        <TextBlock.Background>
                            <SolidColorBrush Opacity="0.50" Color="Black"/>
                        </TextBlock.Background>
                    </TextBlock>
                    <Border Grid.Row="0" Grid.RowSpan="2" BorderThickness="1" Margin="1" x:Name="border" MouseDown="OnImageViewBorderMouseDown">
                        <Image Source="{Binding Thumbnail, Mode=OneWay}" Height="100" Width="100" />
                        <Border.Style>

                            </Style>
                        </Border.Style>
                    </Border>
                </Grid>
            </DataTemplate>
        </ListBox.ItemTemplate>
        <ListBox.ItemsPanel>
            <ItemsPanelTemplate>
                <WrapPanel Orientation="Horizontal" IsItemsHost="True"/>
            </ItemsPanelTemplate>
        </ListBox.ItemsPanel>
    </ListBox>
</Grid>

Image of Problem

Body:
Setting Panel.ZIndex on the Border element in the ItemTemplate has no effect, because the Border is not a direct child of the WrapPanel in the ItemsPanel.

You should instead apply a Style to the ListBoxItem container element, which is created as child of the ItemsPanel, by setting the ListBox's ItemContainerStyle property:

<ListBox ItemsSource="{Binding Images}">
    <ListBox.ItemsPanel>
        <ItemsPanelTemplate>
            <WrapPanel Orientation="Horizontal"/>
        </ItemsPanelTemplate>
    </ListBox.ItemsPanel>
    <ListBox.ItemContainerStyle>
        <Style TargetType="ListBoxItem">
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Panel.ZIndex" Value="1000"/>
                    <Setter Property="RenderTransform">
                        <Setter.Value>
                            <ScaleTransform ScaleX="1.20" ScaleY="1.20"/>
                        </Setter.Value>
                    </Setter>
                </Trigger>
            </Style.Triggers>
        </Style>
    </ListBox.ItemContainerStyle>
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Image Source="{Binding Thumbnail}" Width="100" Height="100"/>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>


问:
5 input and 3 output features for machine learning
Need some advise here.

I am trying to build a model where it can predict the 3 different output features when 5 input features are given.

for example,
5 input features: size of the house, house floor, house condition, number of rooms, parking.
3 output features: price for selling, price for buying,  price for renting

What I am confusing right now is that, is that possible that the trained model are able to predict the 3 outputs? What I found from others' example/tutorial is that they mostly trying to do one thing only on their model.

Sorry if my explanations are bad, I am new to tensorflow and machine learning.

答:
Neural network definitely can predict/approximate more outputs. I have experience with neuron regulator and there net produce control signal for two motors.

So I don't have experience with tensorflow. But this framework is from Google and is quite popular, so I'm almost sure, there is multioutput functionality.

There is nice example of such thing.


问:
Is there a C# equivalent to access-modifier regions in C++
It's possible to declare variables with the below structure in C++

```<code>private:
public:
protected:
    float bla1;
    float bla2;
    float bla3;
</code>```

Is there an equivalent in C#? It seems rather tedious having to repeat yourself;

```<code>protected float bla1;
protected float bla2;
protected float bla3;
</code>```

答:
It's worth noting that if you have several members of the same type, you can declare them as:</p>

```<code>protected float bla1, bla2, bla3;
</code>```

OwnerDisplayName: Adam Naylor

Body:
It's possible to declare variables with the below structure in C++

private:
public:
protected:
    float bla1;
    float bla2;
    float bla3;

Is there an equivalent in C#? It seems rather tedious having to repeat yourself;

protected float bla1;
protected float bla2;
protected float bla3;

Body:
It's worth noting that if you have several members of the same type, you can declare them as:

protected float bla1, bla2, bla3;

OwnerDisplayName: Kent Boogaart