title: Add the values on ArrayList in Android
body: <p>I have develop one application. Here i have to add the value on <code>ArrayList</code>. if i have to click <code>Button</code> means that value have to add on that <code>ArrayList</code>. I have to click another <code>Button</code> means that added list is displaying. How can i do? Please give me solution.</p>
  
  <p><strong>These are my values:</strong></p>
  
  <pre><code> product_id = getIntent().getStringExtra("id");
           product_title = getIntent().getStringExtra("title");
           product_image = getIntent().getStringExtra("image");
           product_price = getIntent().getStringExtra("price");
           product_desc = getIntent().getStringExtra("description");
  
  arrayList = new ArrayList&lt;String&gt;();
      arrayList.add(product_title);
      arrayList.add(product_price);
      arrayList.add(product_id);
      arrayList.add(product_image);
      arrayList.add(product_desc); 
  </code></pre>
  
  <p>I have to add these values on <code>ArrayList</code> while clicking the <code>Button</code>:</p>
  
  <pre><code>  valueaddlist = (Button) findViewById(R.id.valueaddlist);
          valueaddlist.setOnClickListener(new OnClickListener() {
             public void onClick(View v){
      Intent intent = new Intent(this,AddedListProducts.class);
      intent.putExtra("WishListProducts", arrayList);
      startActivity(intent);
     } 
  </code></pre>
  
  <p>In the <code>AddedListProducts</code> have to displaying all added products list.</p>
  
  <p>How can i do ?
  please give me solution for these ?</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>This is my AddedListProducts class code:</p>
  
  <pre><code>wishlist_products = (ListView) findViewById(R.id.wishlist_products);
      if(getIntent().getExtras() !=null){
          WishListProducts = (ArrayList&lt;String&gt;) getIntent().getExtras().getSerializable("WishListProducts");
          System.out.println(WishListProducts);
          wishlistproductsAdapter = new WishListAdapter(this,WishListProducts);
          wishlist_products.setAdapter(wishlistproductsAdapter);
  
       }
  </code></pre>
  
  <p>In these arraylist am getting values.how can i set the value on adapter file and UI.</p>
  
  <p>This is my adapter file code:</p>
  
  <pre><code>     public class WishListAdapter extends BaseAdapter{
  
           WishListAdapter mListViewAdapter;
            private Activity mActivity;
           private ArrayList&lt;String&gt; mwishlistProducts;
          public ImageLoader mImageLoader; 
          private static LayoutInflater inflater=null;
          public WishListAdapter(Activity activity, ArrayList&lt;String&gt; products) {
          mActivity = activity;
             this.mwishlistProducts=products;
            inflater = (LayoutInflater)mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  
          }
  
            class ViewHolder{
              private ImageView productImageView;
  
               private TextView productTitleView;       
                  private TextView productPriceView;  
          private TextView productDescView;   
  
                 public ViewHolder(ImageView productImageView, TextView productTitleView,TextView   productPriceView,TextView productDescView) {
                        super();
          this.productImageView = productImageView;
  
          this.productTitleView = productTitleView;       
          this.productPriceView = productPriceView;       
          this.productDescView = productDescView;     
  
      }
  } // ViewHolder-class
  
  public int getCount() {
      return mwishlistProducts.size();
  
  }
  
  public Object getItem(int position) {
      return position;
  }
  
  public long getItemId(int position) {
      return position;
  }
  
  public View getView(int position, View convertView, ViewGroup parent) {
      View vi=convertView;
      ViewHolder holder;
  
      final String wishlistproductList = mwishlistProducts.get(position);
  
      if( convertView == null )
      {
          convertView = inflater.inflate(R.layout.list_product, null);  
          ImageView productImage=(ImageView)convertView.findViewById(R.id.productimage);
  
          TextView productTitle = (TextView)convertView.findViewById(R.id.producttitle);
          TextView productPrice = (TextView)convertView.findViewById(R.id.productprice);
          TextView productDesc = (TextView)convertView.findViewById(R.id.productdescription);
  
          holder = new ViewHolder(productImage,productTitle,productPrice,productDesc);
          convertView.setTag(holder);
      }else{
          holder = (ViewHolder) convertView.getTag();
      }
      convertView.setOnClickListener(new OnClickListener() {
          @Override
          public void onClick(View v) {
  
                  }
      });
  
      holder.productTitleView.setText();
      holder.productPriceView.setText();
      holder.productDescView.setText();
      mImageLoader=new ImageLoader();
      mImageLoader.DisplayImage();
      return convertView;
  }
  }
  </code></pre>
  
  <p>In these holder file what i have to set ????</p>
  
  <p>How can i set that arraylist value here.please help me yaar..</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>More products  is displaying on one listview.
  Now i have to click one list item means its go to detail description page.here i have to click button means that product detail value is adding and have to display on AddedListProducts Page.</p>
  
  <p>now i ll go to back and click another product means click button means that product detail also added and have to display on AddedListProducts page with that old added products...</p>
  
  <p>i have to add products from that listview and go to next page and clicking button means have to  display that all added products on AddedListProducts page.how can i do ???</p>
  
  <p>Above code ly displaying last added product ly.I want to display all added products on that list.</p>