Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to update seekbar using a edittext
    primarykey
    data
    text
    <p>i read an example of how to show the progres of a seekbar to the edittext this is the web page:</p> <p><a href="http://androidprogramz.blogspot.mx/2012/07/simple-seekbar-in-android.html" rel="nofollow">Simple Seekbar In Android</a></p> <p>now my problem is how to change the seekbar if i introduce a number inside the edittext box? thanks for any help</p> <p>if you can acces the web page i will also post the code:</p> <p>main:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" &gt; &lt;TextView android:id="@+id/textView1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/hello" /&gt; &lt;EditText android:id="@+id/editText1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_marginTop="94dp" &gt; &lt;requestFocus /&gt; &lt;/EditText&gt; &lt;SeekBar android:id="@+id/seekBar1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" android:layout_marginTop="38dp" /&gt; &lt;/RelativeLayout&gt; </code></pre> <p>and the java code:</p> <pre><code>import android.app.Activity; import android.os.Bundle; import android.widget.EditText; import android.widget.SeekBar; import android.widget.SeekBar.OnSeekBarChangeListener; public class SeekbarActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); SeekBar sb=(SeekBar) findViewById(R.id.seekBar1); final EditText et=(EditText) findViewById(R.id.editText1); sb.setOnSeekBarChangeListener(new OnSeekBarChangeListener() { @Override public void onStopTrackingTouch(SeekBar seekBar) { } @Override public void onStartTrackingTouch(SeekBar seekBar) { } @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { //---change the font size of the EditText--- et.setText(String.valueOf(progress)); } }); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload