diff --git a/README.md b/README.md index 9671bcf..5c59b78 100644 --- a/README.md +++ b/README.md @@ -153,12 +153,13 @@ These animations can be set using the attribute noted above like so: `app:sbg_an ##### Listener Example ```java SegmentedButtonGroup segmentedButtonGroup = (SegmentedButtonGroup) findViewById(R.id.segmentedButtonGroup); -segmentedButtonGroup.setOnClickedButtonPosition(new SegmentedButtonGroup.OnClickedButtonPosition() { - @Override - public void onClickedButtonPosition(int position) { - Toast.makeText(MainActivity.this, "Clicked: " + position, Toast.LENGTH_SHORT).show(); - } -}); +segmentedButtonGroup.setOnClickedButtonListener(new SegmentedButtonGroup.OnClickedButtonListener() { + @Override + public void onClickedButton(final int position) { + Toast.makeText(MainActivity.this, "Clicked: " + position, Toast.LENGTH_SHORT).show(); + } + }); + segmentedButtonGroup.setPosition(2, 0); ```