FileDocCategorySizeDatePackage
SeekBar1.javaAPI DocAndroid 1.5 API1928Wed May 06 22:41:08 BST 2009com.example.android.apis.view

SeekBar1

public class SeekBar1 extends android.app.Activity implements SeekBar.OnSeekBarChangeListener
Demonstrates how to use a seek bar

Fields Summary
android.widget.SeekBar
mSeekBar
android.widget.TextView
mProgressText
android.widget.TextView
mTrackingText
Constructors Summary
Methods Summary
protected voidonCreate(android.os.Bundle savedInstanceState)

        super.onCreate(savedInstanceState);

        setContentView(R.layout.seekbar_1);
        
        mSeekBar = (SeekBar)findViewById(R.id.seek);
        mSeekBar.setOnSeekBarChangeListener(this);
        mProgressText = (TextView)findViewById(R.id.progress);
        mTrackingText = (TextView)findViewById(R.id.tracking);
    
public voidonProgressChanged(android.widget.SeekBar seekBar, int progress, boolean fromTouch)

        mProgressText.setText(progress + " " + 
                getString(R.string.seekbar_from_touch) + "=" + fromTouch);
    
public voidonStartTrackingTouch(android.widget.SeekBar seekBar)

        mTrackingText.setText(getString(R.string.seekbar_tracking_on));
    
public voidonStopTrackingTouch(android.widget.SeekBar seekBar)

        mTrackingText.setText(getString(R.string.seekbar_tracking_off));