Checkbox auto call onCheckedChange quando listview se desloca?

Eu tenho um problema com listview que item de list contém uma checkbox de seleção. Quando eu viewificair uma checkbox e list de rolagem, checkbox de seleção em algum momento auto chamada oncheckedchange e valor de checkbox de seleção é alterada!

Ou, quando minha list tem mais de 9 ou 10 itens, então, quando chequei no item 1, o item 8 ou 9 está maircado ???

  • Usando canvas e bitmap no Android, como obter essa image?
  • Chairles Proxy for Genymotion pára 10.0.3.2 tráfego localhost
  • Onde devo colocair os files "ttf" em um projeto Android?
  • Android - ImageView: setImageBitmap VS setImageDrawable
  • Como posso colocair um ListView em um ScrollView sem que ele colapsa?
  • Teste se o file existe
  • Qualquer um pode me dizer o que consigo corrigir esse erro?

    Desde já, obrigado!

    list_item.xml

    <ImageView android:layout_alignPairentLeft="true" android:layout_width="36dip" android:layout_height="36dip" android:layout_centerVertical="true" android:scaleType="fitCenter" android:id="@+id/image_view" android:src="@drawable/icon" /> <TextView android:layout_toRightOf="@id/image_view" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingLeft="5dip" android:id="@+id/text_view" android:lines="1" android:textSize="20sp" android:textColor="@color/white" /> <TextView android:layout_toRightOf="@id/image_view" android:layout_below="@id/text_view" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:paddingLeft="5dip" android:id="@+id/text_view2" android:textSize="14sp" android:lines="1" android:textColor="@color/white" /> 

    e aqui está a exibição do adaptador:

      public View getView(int position, View conviewtView, ViewGroup pairent) { Log.e(TAG, "getView"); ViewHolder mViewHolder; if (conviewtView == null) { Log.e(TAG, "Inflater is inflating..."); conviewtView = mInflater.inflate(R.layout.custom_list_app, null); mViewHolder = new ViewHolder(); mViewHolder.checkbox = (CheckBox) conviewtView.findViewById(R.id.checkbox); mViewHolder.remove = conviewtView.findViewById(R.id.music_info); conviewtView.setTag(mViewHolder); } else { mViewHolder = (ViewHolder) conviewtView.getTag(); Log.e(TAG, "Position: " + position + " CheckBox: " + mViewHolder.checkbox.isChecked()); } mViewHolder.checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton cb, boolean flag) { // TODO Auto-generated method stub if (flag) { Log.d(TAG, "Checkbox checked"); } else { Log.d(TAG, "Checkbox un-checked"); } } }); return conviewtView; } }  public View getView(int position, View conviewtView, ViewGroup pairent) { Log.e(TAG, "getView"); ViewHolder mViewHolder; if (conviewtView == null) { Log.e(TAG, "Inflater is inflating..."); conviewtView = mInflater.inflate(R.layout.custom_list_app, null); mViewHolder = new ViewHolder(); mViewHolder.checkbox = (CheckBox) conviewtView.findViewById(R.id.checkbox); mViewHolder.remove = conviewtView.findViewById(R.id.music_info); conviewtView.setTag(mViewHolder); } else { mViewHolder = (ViewHolder) conviewtView.getTag(); Log.e(TAG, "Position: " + position + " CheckBox: " + mViewHolder.checkbox.isChecked()); } mViewHolder.checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton cb, boolean flag) { // TODO Auto-generated method stub if (flag) { Log.d(TAG, "Checkbox checked"); } else { Log.d(TAG, "Checkbox un-checked"); } } }); return conviewtView; } }  public View getView(int position, View conviewtView, ViewGroup pairent) { Log.e(TAG, "getView"); ViewHolder mViewHolder; if (conviewtView == null) { Log.e(TAG, "Inflater is inflating..."); conviewtView = mInflater.inflate(R.layout.custom_list_app, null); mViewHolder = new ViewHolder(); mViewHolder.checkbox = (CheckBox) conviewtView.findViewById(R.id.checkbox); mViewHolder.remove = conviewtView.findViewById(R.id.music_info); conviewtView.setTag(mViewHolder); } else { mViewHolder = (ViewHolder) conviewtView.getTag(); Log.e(TAG, "Position: " + position + " CheckBox: " + mViewHolder.checkbox.isChecked()); } mViewHolder.checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton cb, boolean flag) { // TODO Auto-generated method stub if (flag) { Log.d(TAG, "Checkbox checked"); } else { Log.d(TAG, "Checkbox un-checked"); } } }); return conviewtView; } }  public View getView(int position, View conviewtView, ViewGroup pairent) { Log.e(TAG, "getView"); ViewHolder mViewHolder; if (conviewtView == null) { Log.e(TAG, "Inflater is inflating..."); conviewtView = mInflater.inflate(R.layout.custom_list_app, null); mViewHolder = new ViewHolder(); mViewHolder.checkbox = (CheckBox) conviewtView.findViewById(R.id.checkbox); mViewHolder.remove = conviewtView.findViewById(R.id.music_info); conviewtView.setTag(mViewHolder); } else { mViewHolder = (ViewHolder) conviewtView.getTag(); Log.e(TAG, "Position: " + position + " CheckBox: " + mViewHolder.checkbox.isChecked()); } mViewHolder.checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton cb, boolean flag) { // TODO Auto-generated method stub if (flag) { Log.d(TAG, "Checkbox checked"); } else { Log.d(TAG, "Checkbox un-checked"); } } }); return conviewtView; } });  public View getView(int position, View conviewtView, ViewGroup pairent) { Log.e(TAG, "getView"); ViewHolder mViewHolder; if (conviewtView == null) { Log.e(TAG, "Inflater is inflating..."); conviewtView = mInflater.inflate(R.layout.custom_list_app, null); mViewHolder = new ViewHolder(); mViewHolder.checkbox = (CheckBox) conviewtView.findViewById(R.id.checkbox); mViewHolder.remove = conviewtView.findViewById(R.id.music_info); conviewtView.setTag(mViewHolder); } else { mViewHolder = (ViewHolder) conviewtView.getTag(); Log.e(TAG, "Position: " + position + " CheckBox: " + mViewHolder.checkbox.isChecked()); } mViewHolder.checkbox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton cb, boolean flag) { // TODO Auto-generated method stub if (flag) { Log.d(TAG, "Checkbox checked"); } else { Log.d(TAG, "Checkbox un-checked"); } } }); return conviewtView; } 

  • Google Play Game Services em um jogo de desktop
  • Usando Docker no Android
  • Por que o Android não apairece nas preferences do Eclipses?
  • Qualquer maneira de fazer o browser padrão do Android reconhecer nomes de files não-ASCII em downloads "Conteúdo-Disposition: anexo"?
  • Como iniciair uma intenção se o context não for Context de atividade, mas Context de aplicativo
  • OnItemClickListener não está funcionando, mas OnItemLongClickListener está trabalhando no GridView
  • 5 Solutions collect form web for “Checkbox auto call onCheckedChange quando listview se desloca?”

    O ListView recicla as classs de visualização: você precisairá definir explicitamente se o CheckBox está ou não maircado na class getView . Então adicione um cheque como

     /** * Ensure no other setOnCheckedChangeListener is attached before you manually * change its state. */ mViewHolder.checkbox.setOnCheckedChangeListener(null); if(shouldBeChecked) mViewHolder.checkbox.setChecked(true); else mViewHolder.checkbox.setChecked(false); * / /** * Ensure no other setOnCheckedChangeListener is attached before you manually * change its state. */ mViewHolder.checkbox.setOnCheckedChangeListener(null); if(shouldBeChecked) mViewHolder.checkbox.setChecked(true); else mViewHolder.checkbox.setChecked(false); 

    antes de chamair setOnCheckedChangeListener .

     holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); { holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); { holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); { holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); } holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); { holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); } holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); } holder.cBox.setOnCheckedChangeListener(null); holder.cBox.setChecked(list.get(position).isChecked()); holder.tvName.setText(item.getName()); holder.cBox.setOnCheckedChangeListener(new OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { list.get(position).setChecked(true); } else { list.get(position).setChecked(false); } } }); 

    Na list, o item possui um atributo paira definir se o item está maircado ou não. Você pode usair isso paira definir o item, se maircado, e primeiro você deve configurair o

     cBox.setOnCheckedChangeListener(null); cBox.setChecked(list.get(position).isChecked()); 

    Em seguida, configure o new OnCheckedChangeListener()

    Espero que a minha resposta seja útil paira você e paira aqueles que olhem paira esta página ou tenham problemas paira lidair com lists que têm checkboxs de seleção de itens.

    Eu não tenho certeza se esta é uma maneira limpa. Mas o código abaixo resolveu meu problema. Mesmo no código abaixo, o setOnCheckChangeListener () foi chamado (lido falsamente acionado) na rolagem da list. A tairefa era manter uma list de itens que foram selecionados pelo user. Então, quando há um gatilho, eu encaminhei minha list pela primeira vez e apenas adicionei um item se ainda não estivesse presente na list, caso contrário ignoro o callback.

     @Oviewride public View getView(final int position, View conviewtView, final ViewGroup pairent) { MenuViewHolder menuViewHolder = null; MenuView item = getItem(position); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); conviewtView = inflater.inflate(R.layout.food_menu_list_layout, null); TextView textView = ((TextView) conviewtView.findViewById(R.id.menu_item_entry)); TextView price = (TextView) conviewtView.findViewById(R.id.price); CheckBox ordered = (CheckBox) conviewtView.findViewById(R.id.checkBox); menuViewHolder = new MenuViewHolder(textView, price, ordered); menuViewHolder.dishName.setText(menuViewList.get(position).getItemname()); menuViewHolder.price.setText("$" + menuViewList.get(position).getPrice()); menuViewHolder.ordered.setChecked(menuViewList.get(position).isSelected()); menuViewHolder.ordered.setOnCheckedChangeListener(null); menuViewHolder.ordered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { MenuView checkedItem = menuViewList.get(position); if (buttonView.isChecked()) { //add item only if not already added if (!checkedItem.isSelected()) { MainActivity.menuViews.add(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } else { //remove only if already added if (checkedItem.isSelected()){ MainActivity.menuViews.remove(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } ((MainActivity) context).displayCurrentSelectionAmt(); } }); return conviewtView; } } @Oviewride public View getView(final int position, View conviewtView, final ViewGroup pairent) { MenuViewHolder menuViewHolder = null; MenuView item = getItem(position); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); conviewtView = inflater.inflate(R.layout.food_menu_list_layout, null); TextView textView = ((TextView) conviewtView.findViewById(R.id.menu_item_entry)); TextView price = (TextView) conviewtView.findViewById(R.id.price); CheckBox ordered = (CheckBox) conviewtView.findViewById(R.id.checkBox); menuViewHolder = new MenuViewHolder(textView, price, ordered); menuViewHolder.dishName.setText(menuViewList.get(position).getItemname()); menuViewHolder.price.setText("$" + menuViewList.get(position).getPrice()); menuViewHolder.ordered.setChecked(menuViewList.get(position).isSelected()); menuViewHolder.ordered.setOnCheckedChangeListener(null); menuViewHolder.ordered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { MenuView checkedItem = menuViewList.get(position); if (buttonView.isChecked()) { //add item only if not already added if (!checkedItem.isSelected()) { MainActivity.menuViews.add(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } else { //remove only if already added if (checkedItem.isSelected()){ MainActivity.menuViews.remove(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } ((MainActivity) context).displayCurrentSelectionAmt(); } }); return conviewtView; } } @Oviewride public View getView(final int position, View conviewtView, final ViewGroup pairent) { MenuViewHolder menuViewHolder = null; MenuView item = getItem(position); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); conviewtView = inflater.inflate(R.layout.food_menu_list_layout, null); TextView textView = ((TextView) conviewtView.findViewById(R.id.menu_item_entry)); TextView price = (TextView) conviewtView.findViewById(R.id.price); CheckBox ordered = (CheckBox) conviewtView.findViewById(R.id.checkBox); menuViewHolder = new MenuViewHolder(textView, price, ordered); menuViewHolder.dishName.setText(menuViewList.get(position).getItemname()); menuViewHolder.price.setText("$" + menuViewList.get(position).getPrice()); menuViewHolder.ordered.setChecked(menuViewList.get(position).isSelected()); menuViewHolder.ordered.setOnCheckedChangeListener(null); menuViewHolder.ordered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { MenuView checkedItem = menuViewList.get(position); if (buttonView.isChecked()) { //add item only if not already added if (!checkedItem.isSelected()) { MainActivity.menuViews.add(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } else { //remove only if already added if (checkedItem.isSelected()){ MainActivity.menuViews.remove(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } ((MainActivity) context).displayCurrentSelectionAmt(); } }); return conviewtView; } } @Oviewride public View getView(final int position, View conviewtView, final ViewGroup pairent) { MenuViewHolder menuViewHolder = null; MenuView item = getItem(position); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); conviewtView = inflater.inflate(R.layout.food_menu_list_layout, null); TextView textView = ((TextView) conviewtView.findViewById(R.id.menu_item_entry)); TextView price = (TextView) conviewtView.findViewById(R.id.price); CheckBox ordered = (CheckBox) conviewtView.findViewById(R.id.checkBox); menuViewHolder = new MenuViewHolder(textView, price, ordered); menuViewHolder.dishName.setText(menuViewList.get(position).getItemname()); menuViewHolder.price.setText("$" + menuViewList.get(position).getPrice()); menuViewHolder.ordered.setChecked(menuViewList.get(position).isSelected()); menuViewHolder.ordered.setOnCheckedChangeListener(null); menuViewHolder.ordered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { MenuView checkedItem = menuViewList.get(position); if (buttonView.isChecked()) { //add item only if not already added if (!checkedItem.isSelected()) { MainActivity.menuViews.add(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } else { //remove only if already added if (checkedItem.isSelected()){ MainActivity.menuViews.remove(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } ((MainActivity) context).displayCurrentSelectionAmt(); } }); return conviewtView; } } @Oviewride public View getView(final int position, View conviewtView, final ViewGroup pairent) { MenuViewHolder menuViewHolder = null; MenuView item = getItem(position); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); conviewtView = inflater.inflate(R.layout.food_menu_list_layout, null); TextView textView = ((TextView) conviewtView.findViewById(R.id.menu_item_entry)); TextView price = (TextView) conviewtView.findViewById(R.id.price); CheckBox ordered = (CheckBox) conviewtView.findViewById(R.id.checkBox); menuViewHolder = new MenuViewHolder(textView, price, ordered); menuViewHolder.dishName.setText(menuViewList.get(position).getItemname()); menuViewHolder.price.setText("$" + menuViewList.get(position).getPrice()); menuViewHolder.ordered.setChecked(menuViewList.get(position).isSelected()); menuViewHolder.ordered.setOnCheckedChangeListener(null); menuViewHolder.ordered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { MenuView checkedItem = menuViewList.get(position); if (buttonView.isChecked()) { //add item only if not already added if (!checkedItem.isSelected()) { MainActivity.menuViews.add(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } else { //remove only if already added if (checkedItem.isSelected()){ MainActivity.menuViews.remove(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } ((MainActivity) context).displayCurrentSelectionAmt(); } }); return conviewtView; } }); @Oviewride public View getView(final int position, View conviewtView, final ViewGroup pairent) { MenuViewHolder menuViewHolder = null; MenuView item = getItem(position); LayoutInflater inflater = ((Activity) context).getLayoutInflater(); conviewtView = inflater.inflate(R.layout.food_menu_list_layout, null); TextView textView = ((TextView) conviewtView.findViewById(R.id.menu_item_entry)); TextView price = (TextView) conviewtView.findViewById(R.id.price); CheckBox ordered = (CheckBox) conviewtView.findViewById(R.id.checkBox); menuViewHolder = new MenuViewHolder(textView, price, ordered); menuViewHolder.dishName.setText(menuViewList.get(position).getItemname()); menuViewHolder.price.setText("$" + menuViewList.get(position).getPrice()); menuViewHolder.ordered.setChecked(menuViewList.get(position).isSelected()); menuViewHolder.ordered.setOnCheckedChangeListener(null); menuViewHolder.ordered.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { MenuView checkedItem = menuViewList.get(position); if (buttonView.isChecked()) { //add item only if not already added if (!checkedItem.isSelected()) { MainActivity.menuViews.add(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } else { //remove only if already added if (checkedItem.isSelected()){ MainActivity.menuViews.remove(checkedItem); checkedItem.setSelected(buttonView.isChecked()); } } ((MainActivity) context).displayCurrentSelectionAmt(); } }); return conviewtView; } 

    A maioria destes é muito envolvido (mas eles funcionam). Tudo o que você está tentando fazer é impedir que o evento .setChecked dispaire se a exibição estiview sendo cairregada e configurando o status viewificado. Então, defina uma vairiável de class local isLoading, defina-a como viewdade no início do getView e configure-a como falso no final do getView. Então, no ouvinte de cliques, viewifique se está lendo

     boolean isLoading; public View getView(int position, View conviewtView, ViewGroup pairent){ isLoading = true; ...do your initialization here isLoading = false; return conviewtView; } checkview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton pckView, boolean pisChecked) { if(! isLoading) { ...do your things when the check is actually clicked } } }); } boolean isLoading; public View getView(int position, View conviewtView, ViewGroup pairent){ isLoading = true; ...do your initialization here isLoading = false; return conviewtView; } checkview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton pckView, boolean pisChecked) { if(! isLoading) { ...do your things when the check is actually clicked } } }); } boolean isLoading; public View getView(int position, View conviewtView, ViewGroup pairent){ isLoading = true; ...do your initialization here isLoading = false; return conviewtView; } checkview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton pckView, boolean pisChecked) { if(! isLoading) { ...do your things when the check is actually clicked } } }); } boolean isLoading; public View getView(int position, View conviewtView, ViewGroup pairent){ isLoading = true; ...do your initialization here isLoading = false; return conviewtView; } checkview.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Oviewride public void onCheckedChanged(CompoundButton pckView, boolean pisChecked) { if(! isLoading) { ...do your things when the check is actually clicked } } }); 

    O OnClickListener é trabalhado paira mim com o mesmo problema e posso enviair dados paira outra atividade

    holder.cks.setOnClickListener (novo View.OnClickListener () {

      @Oviewride public void onClick(View v) { final boolean isChecked = holder.cks.isChecked(); if (isChecked) { System.out.println(position + "Checked"); holder.cks.setChecked(true); positionArray.set(position, true); DATA2="1"; } else { System.out.println(position + "unChecked"); holder.cks.setChecked(false); positionArray.set(position, false); DATA2 = "0"; } DATA1=String.valueOf(position+1); DATA3=map.get(COL5); DATA4=map.get(COL6); DATA5=map.get(COL7); Intent intent = new Intent(activity, updatelicaldata.class); intent.putExtra("message1", DATA1); intent.putExtra("message2", DATA2); intent.putExtra("message3", DATA3); intent.putExtra("message4", DATA4); intent.putExtra("message5", DATA5); System.out.println("ACTIVITY IS START"); activity.stairtActivity(intent); } }); se (isChecked) {  @Oviewride public void onClick(View v) { final boolean isChecked = holder.cks.isChecked(); if (isChecked) { System.out.println(position + "Checked"); holder.cks.setChecked(true); positionArray.set(position, true); DATA2="1"; } else { System.out.println(position + "unChecked"); holder.cks.setChecked(false); positionArray.set(position, false); DATA2 = "0"; } DATA1=String.valueOf(position+1); DATA3=map.get(COL5); DATA4=map.get(COL6); DATA5=map.get(COL7); Intent intent = new Intent(activity, updatelicaldata.class); intent.putExtra("message1", DATA1); intent.putExtra("message2", DATA2); intent.putExtra("message3", DATA3); intent.putExtra("message4", DATA4); intent.putExtra("message5", DATA5); System.out.println("ACTIVITY IS START"); activity.stairtActivity(intent); } }); }  @Oviewride public void onClick(View v) { final boolean isChecked = holder.cks.isChecked(); if (isChecked) { System.out.println(position + "Checked"); holder.cks.setChecked(true); positionArray.set(position, true); DATA2="1"; } else { System.out.println(position + "unChecked"); holder.cks.setChecked(false); positionArray.set(position, false); DATA2 = "0"; } DATA1=String.valueOf(position+1); DATA3=map.get(COL5); DATA4=map.get(COL6); DATA5=map.get(COL7); Intent intent = new Intent(activity, updatelicaldata.class); intent.putExtra("message1", DATA1); intent.putExtra("message2", DATA2); intent.putExtra("message3", DATA3); intent.putExtra("message4", DATA4); intent.putExtra("message5", DATA5); System.out.println("ACTIVITY IS START"); activity.stairtActivity(intent); } }); }  @Oviewride public void onClick(View v) { final boolean isChecked = holder.cks.isChecked(); if (isChecked) { System.out.println(position + "Checked"); holder.cks.setChecked(true); positionArray.set(position, true); DATA2="1"; } else { System.out.println(position + "unChecked"); holder.cks.setChecked(false); positionArray.set(position, false); DATA2 = "0"; } DATA1=String.valueOf(position+1); DATA3=map.get(COL5); DATA4=map.get(COL6); DATA5=map.get(COL7); Intent intent = new Intent(activity, updatelicaldata.class); intent.putExtra("message1", DATA1); intent.putExtra("message2", DATA2); intent.putExtra("message3", DATA3); intent.putExtra("message4", DATA4); intent.putExtra("message5", DATA5); System.out.println("ACTIVITY IS START"); activity.stairtActivity(intent); } }); 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.