title: Incrementing and decrementing in expandable listview
body: <p>I have created the expandablelisview.If i click the plus imageview in child items the value of count is increased by 1. Initially the count value is 0 for all child item.If i click the plus in 1st row,the count value increased from 0 to 1.After that,i clicked the 2nd row means the count value increased from 1 to 2.I want to increase the count value as 0 to 1 in not 1 to 2 in 2nd row`</p>
  
  <pre><code>public class ExpandListAdapter extends BaseExpandableListAdapter {
  
      private Context context;
      private ArrayList&lt;Group&gt; groups;
      ArrayList&lt;Child&gt; ch_list=new ArrayList&lt;Child&gt;();
  
      Integer count=0;
  
      public class ViewHolder {
  
          TextView tv ;
          ImageView food_image;
          ImageView minus,plus ;
           TextView item_count;
  
      }
  
  
      public ExpandListAdapter(Context context, ArrayList&lt;Group&gt; groups) {
          this.context = context;
          this.groups = groups;
  
      }
  
  
      @Override
      public Object getChild(int groupPosition, int childPosition) {
          ArrayList&lt;Child&gt; chList = groups.get(groupPosition).getItems();
          return chList.get(childPosition);
      }
  
      @Override
      public long getChildId(int groupPosition, int childPosition) {
          return childPosition;
      }
  
      @Override
      public View getChildView(final int groupPosition, final int childPosition,
                               boolean isLastChild, View convertView, ViewGroup parent) {
  
          final Child child = (Child) getChild(groupPosition, childPosition);
  
  
  
          ViewHolder viewHolder = null;
          if (convertView == null) {
              LayoutInflater inflator = LayoutInflater.from(parent.getContext());
              convertView = inflator.inflate(R.layout.detail_list, null);
              viewHolder = new ViewHolder();
  
              viewHolder.tv = (TextView) convertView.findViewById(R.id.type);
              viewHolder.food_image = (ImageView) convertView.findViewById(R.id.food_image);
              viewHolder.minus = (ImageView) convertView.findViewById(R.id.minus);
              viewHolder.plus = (ImageView) convertView.findViewById(R.id.plus);
              viewHolder.item_count = (TextView) convertView.findViewById(R.id.count);
  
  
              convertView.setTag(viewHolder);
  
  
          }
          else {
              viewHolder = (ViewHolder) convertView.getTag();
          }
  
  
          viewHolder.tv.setText(child.getName().toString());
  
  
          final ViewHolder finalViewHolder = viewHolder;
          viewHolder.plus.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
  
                  count=count+1;
                  finalViewHolder.item_count.setText(count.toString());
              }
          });
  
  
  
  
          final ViewHolder finalViewHolder1 = viewHolder;
          viewHolder.minus.setOnClickListener(new View.OnClickListener() {
              @Override
              public void onClick(View v) {
                  // TODO Auto-generated method stub
  
                  count=count-1;
                  finalViewHolder1.item_count.setText(count.toString());   //Key -&gt; String.valueOf(position) and Value -&gt; int count
              }
          });
  
          return convertView;
      }
  
      @Override
      public  int getChildrenCount(int groupPosition) {
          ArrayList&lt;Child&gt; chList = groups.get(groupPosition).getItems();
          return chList.size();
      }
  
      @Override
      public Object getGroup(int groupPosition) {
          return groups.get(groupPosition);
      }
  
      @Override
      public int getGroupCount() {
          return groups.size();
      }
  
      @Override
      public long getGroupId(int groupPosition) {
          return groupPosition;
      }
  
      @Override
      public View getGroupView(int groupPosition, boolean isExpanded,
                               View convertView, ViewGroup parent) {
          Group group = (Group) getGroup(groupPosition);
          if (convertView == null) {
              LayoutInflater inf = (LayoutInflater) context
                      .getSystemService(context.LAYOUT_INFLATER_SERVICE);
              convertView = inf.inflate(R.layout.group_item, null);
          }
          TextView tv = (TextView) convertView.findViewById(R.id.group_name);
          tv.setText(group.getName());
          ExpandableListView eLV = (ExpandableListView) parent;
          int count = getGroupCount();
                            if(count&lt;1){
  
                               eLV.expandGroup(groupPosition);
                               // eLV.setGroupIndicator(null);
                            }
  
  
          return convertView;
      }
  
  
  
      @Override
      public boolean hasStableIds() {
          return true;
      }
  
      @Override
      public boolean isChildSelectable(int groupPosition, int childPosition) {
          return true;
      }
  
  }
  </code></pre>
  
  <p>Logcat error`</p>
  
  <pre><code>FATAL EXCEPTION: main
                                                                         Process: abservetech.com.foodapp, PID: 1807
                                                                         android.content.res.Resources$NotFoundException: Unable to find resource ID #0x1
                                                                             at android.content.res.Resources.getResourcePackageName(Resources.java:1871)
                                                                             at android.content.res.SPRDResources.getThemeResources(SPRDResources.java:94)
                                                                             at android.content.res.SPRDResources.getText(SPRDResources.java:155)
                                                                             at android.support.v7.widget.ResourcesWrapper.getText(ResourcesWrapper.java:52)
                                                                             at android.widget.TextView.setText(TextView.java:3927)
                                                                             at abservetech.com.foodapp.ExpandListAdapter$1.onClick(ExpandListAdapter.java:99)
                                                                             at android.view.View.performClick(View.java:4446)
                                                                             at android.view.View$PerformClick.run(View.java:18437)
                                                                             at android.os.Handler.handleCallback(Handler.java:733)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:95)
                                                                             at android.os.Looper.loop(Looper.java:136)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:5372)
                                                                             at java.lang.reflect.Method.invokeNative(Native Method)
                                                                             at java.lang.reflect.Method.invoke(Method.java:515)
                                                                             at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:970)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:786)
                                                                             at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>`</p>