Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@codeforfun-jp
Created July 12, 2022 06:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codeforfun-jp/4b3a8564d3766bdde026aa485f843bf9 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/4b3a8564d3766bdde026aa485f843bf9 to your computer and use it in GitHub Desktop.
【Java】How to Use SeekBar 4
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/* 省略 */
// SeekBarイベント
seekbar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
@Override
public void onProgressChanged(SeekBar seekBar, int i, boolean b) {
textView.setText(i + "");
}
@Override
public void onStartTrackingTouch(SeekBar seekBar) {
}
@Override
public void onStopTrackingTouch(SeekBar seekBar) {
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment