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/9e9318b8fe594930200119a408e60ab9 to your computer and use it in GitHub Desktop.
Save codeforfun-jp/9e9318b8fe594930200119a408e60ab9 to your computer and use it in GitHub Desktop.
【Java】How to Use SeekBar 3
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
/* 省略 */
// 「リセット」を押したら50にする
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
seekbar.setProgress(50);
}
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment