title: Delete the image from imageview onclick deletebutton
body: <p>I want to delete the image when the user click delete button and replace by next image from the Array.</p>
  
  <p>here i have taken horizontal list view to display images,in each view i have added delete button ,On-click delete button i want to delete the image.</p>
  
  <p>code:</p>
  
  <pre><code>private class  Horiadapter extends BaseAdapter {
  
          public Horiadapter(){
              super();
          }
          private OnClickListener mOnButtonClicked = new OnClickListener() {
  
              public void onClick(View v) {
                  Button bt = (Button) v;
  
                  Toast.makeText(getApplicationContext(), "pressed " + bt.getText(), Toast.LENGTH_SHORT).show();          
              }
          };
  
  
          public int getCount() {
              return dataObjects.length;
          }
  
          public Object getItem(int position) {
              return null;
          }
  
          public long getItemId(int position) {
              return 0;
          }
  
  
          public View getView(int position, View convertView, ViewGroup parent) {
              View viewitems = LayoutInflater.from(parent.getContext()).inflate(R.layout.viewitem, null);
  
              ImageView images=(ImageView)viewitems.findViewById(R.id.image);
              Button button = (Button) viewitems.findViewById(R.id.delbutton);
  
              button.setOnClickListener(mOnButtonClicked);
  
              images.setImageResource(imageIds[position]);
  
              return viewitems;
          }
  
      };
  </code></pre>
  
  <p>I would really be thankful if anybody could help me.</p>