2013-02-21 79 views
0

enter image description here如何從android中的動態視圖中獲取動態選擇的值?

如何從linearlayout中動態創建的複選框中選擇複選框值。 請幫我一把。

+0

你問一個同樣的問題,http://stackoverflow.com/questions/14994901/how-to-get-dynamic-created-checkbox -selected-value-from-the-view-position-in-and。標記爲重複 – Geros 2013-02-21 06:19:42

+0

是的,但是Sir在這裏找不到任何迴應 – vabhavsingh 2013-02-21 06:21:07

回答

0

您可以在複選框的CheckedChange listner上使用。

例子:chkBox.setOnCheckedChangeListener(新OnCheckedChangeListener(){

 @Override 
     public void onCheckedChanged(CompoundButton buttonView, 
       boolean isChecked) { 
      if (isChecked) { 
       //Do operations when checked 
      } 

     } 
    }); 
+0

thanx for quick reposne但我用這個代碼但是它取代了第一個選擇的值。 selelcted value in the arryalist。 – vabhavsingh 2013-02-21 06:26:50

+0

and please se我之前的同一個問題代碼http://stackoverflow.com/questions/14994901/how-to-get-dynamic-created-checkbox-selected-value-from-the-view-position -in和 – vabhavsingh 2013-02-21 06:28:36