I want to change the seekbar progress position by changing the value in EditText dynamically. please help me out from this issue .
<EditText
android:id="@+id/editText1"
android:layout_width="120dp"
android:layout_height="wrap_content" />
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:max="4990000"
android:progress="10" />
这是java代码
seekbar1 = (SeekBar) findViewById(R.id.seekBar1);
seekbar1.setProgress(30);
seekbar1.setOnSeekBarChangeListener( new OnSeekBarChangeListener()
{
public void onProgressChanged(SeekBar seekBar, int progress,boolean fromUser)
{
spinnervalue=(EditText)findViewById(R.id.editText1);
spinnervalue.setText(""+Integer.toString(progress));
// Notify that the progress level has changed.
if(txtAmount.getText().length() > 0
&& txtYears.getText().length() > 0
&& txtRate.getText().length() > 0)
{
calculate();
}
}
});
因此,通过根据输入的值更改编辑文本中的值,必须将搜索栏移动到特定值。