title: How to get the value for each seek bar created in list view Android?
body: <p>may I know how to get the specific value for each <code>SeekBar</code> which I have created in custom <code>ListView</code>? I am able to create the static one but what if i want to retrieve the value for each <code>SeekBar</code> in the custom <code>ListView</code> based on my sliding? Thank you.</p>
  
  <p>--Activity code--</p>
  
  <pre><code>public class DisplayAssessmentActivity extends ActionBarActivity {
  
  ListDatabaseHandler listCriteria;
  private SimpleCursorAdapter dataAdapter;
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_display_assessment);
  
      //Open connection and get instance from database
      listCriteria = new ListDatabaseHandler(this);
      listCriteria.open();
  
      //Delete all data
      listCriteria.deleteAllCriteria();
  
      //Add data
      listCriteria.insertSomeCriteria();
  
      //Retrieve data from database and display in list view
      displayCriteriaListView();
  }
  
  private void displayCriteriaListView() {
  
      Cursor cursor = listCriteria.fetchAllCriteria();
  
      // The desired columns to be bound
      String[] columns = new String[] {
              ListDatabaseHandler.KEY_CRITERIANAME,
              ListDatabaseHandler.KEY_CRITERIAWEIGHTAGE,
  
      };
  
      // the XML defined views which the data will be bound to
      int[] to = new int[] {
              R.id.criteriaName,
              R.id.criteriaWeightage
      };
  
      // create the adapter using the cursor pointing to the desired data
      //as well as the layout information
      dataAdapter = new SimpleCursorAdapter(
              this, R.layout.activity_list_criteria,
              cursor,
              columns,
              to,
              0);
  
      ListView listView = (ListView) findViewById(R.id.criteriaListView);
      // Assign adapter to ListView
      listView.setAdapter(dataAdapter);
  
      //Action when click on the item
      listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
          @Override
          public void onItemClick(AdapterView&lt;?&gt; listView, View view,
                                  int position, long id) {
              // Get the cursor, positioned to the corresponding row in the result set
              Cursor cursor = (Cursor) listView.getItemAtPosition(position);
  
              //Get matric number from this row in the database
              String criteria = cursor.getString(cursor.getColumnIndexOrThrow("criteria_name"));
  
              // Get the state's capital from this row in the database.
              String weightage =
                      cursor.getString(cursor.getColumnIndexOrThrow("criteria_weightage"));
  
              //Toast.makeText(getApplicationContext(),
              //subjectName, Toast.LENGTH_SHORT).show();
  
  
              Intent intentResult = new Intent(getApplicationContext(), ResultActivity.class);
  
              startActivity(intentResult);
  
          }
      });
  
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      // Inflate the menu; this adds items to the action bar if it is present.
      getMenuInflater().inflate(R.menu.menu_display_assessment, menu);
      return true;
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      // Handle action bar item clicks here. The action bar will
      // automatically handle clicks on the Home/Up button, so long
      // as you specify a parent activity in AndroidManifest.xml.
      int id = item.getItemId();
  
      //noinspection SimplifiableIfStatement
      if (id == R.id.action_settings) {
          return true;
      }
  
      return super.onOptionsItemSelected(item);
  }
  </code></pre>
  
  <p>activity_list_criteria.xml</p>
  
  <p><code>enter code here</code>
      </p>
  
  <pre><code>    //Label criteria
      &lt;TextView
          android:id="@+id/txtViewCriteria"
          android:textSize="20sp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Criteria      : " /&gt;
  
      //Label criteria from db
      &lt;TextView
          android:id="@+id/criteriaName"
          android:textSize="20sp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/textView1"
          android:text="Criteria" /&gt;
  
      &lt;TextView
          android:layout_width="180dp"
          android:layout_height="fill_parent" /&gt;
  
  
  &lt;/LinearLayout&gt;
  
  //SeekBar layout
  &lt;SeekBar
      android:id="@+id/sbBar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:progress="0"
      android:max="5"
      android:paddingTop="20dp" /&gt;
  
  //TextViews for SeekBarlegend
  &lt;RelativeLayout
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="center"
      android:orientation="horizontal" &gt;
  
      &lt;TextView
          android:id="@+id/tvLabel1"
          android:paddingLeft="10dp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="0" /&gt;
  
      &lt;TextView
          android:id="@+id/tvLabel3"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignParentRight="true"
          android:paddingRight="10dp"
          android:text="5" /&gt;
  
  &lt;/RelativeLayout&gt;
  
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="35dp"&gt;
  
      //Label weightage
      &lt;TextView
          android:id="@+id/txtViewWeightage"
          android:textSize="20sp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:text="Weightage: "/&gt;
  
      //Label weightage from db
      &lt;TextView
          android:id="@+id/criteriaWeightage"
          android:textSize="20sp"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_above="@+id/stuMatric"
          android:layout_toRightOf="@+id/textView2"
          android:text="Weightage" /&gt;
  
  &lt;/LinearLayout&gt;
  </code></pre>
  
  <p></p>
  
  <p>activity_display_assessment.xml</p>
  
  <pre><code>//Title Layout
  &lt;LinearLayout
      android:layout_width="fill_parent"
      android:layout_height="60dp"
      android:orientation="vertical"&gt;
  
      &lt;LinearLayout
          android:layout_width="fill_parent"
          android:layout_height="60dp"
          android:background="@drawable/orangehome"
          android:orientation="horizontal"&gt;
  
          &lt;TextView
              android:layout_width="110dp"
              android:layout_height="fill_parent" /&gt;
  
          &lt;TextView
              android:layout_width="170dp"
              android:text="Evaluate"
              android:layout_gravity="center_horizontal"
              android:gravity="center"
              android:textColor="#FFFFFF"
              android:textSize="30sp"
              android:layout_height="60dp" /&gt;
  
          &lt;TextView
              android:layout_width="50dp"
              android:layout_height="fill_parent" /&gt;
  
          &lt;Button
              android:id="@+id/btnLogout"
              android:layout_width="40dp"
              android:layout_height="40dp"
              android:layout_gravity="center_vertical"
              android:background="@drawable/logout"/&gt;
  
      &lt;/LinearLayout&gt;
  
  &lt;/LinearLayout&gt;
  
  //Criteria layout
  &lt;TextView
      android:id="@+id/txtViewSubject"
      android:paddingTop="10dp"
      android:layout_gravity="center_horizontal"
      android:gravity="center"
      android:layout_width="300dp"
      android:layout_height="60dp"
      android:textSize="18sp"
      android:textColor="#000000"
      android:text="Criteria"/&gt;
  
  //List view for criteria
  &lt;ListView
      android:id="@+id/criteriaListView"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent" /&gt;
  </code></pre>
  
  <p></p>