Back to project page CenteredContentButton.
The source code is released under:
Apache License
If you think the Android project CenteredContentButton listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.skd.centeredcontentbutton_tabstest; //from w w w . j a v a 2 s. c o m import android.app.Activity; import android.os.Bundle; import android.widget.Toast; import com.skd.centeredcontentbutton.CenteredContentToggleButton; import com.skd.centeredcontentbutton.CenteredContentToggleGroup; import com.skd.centeredcontentbutton.CenteredContentToggleGroup.OnCheckedChangeListener; public class MainActivity extends Activity implements OnCheckedChangeListener { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); CenteredContentToggleGroup tabs = (CenteredContentToggleGroup) findViewById(R.id.tabs); tabs.setOnCheckedChangeListener(this); } @Override public void onCheckedChanged(CenteredContentToggleGroup group, int checkedId) { CenteredContentToggleButton tab = (CenteredContentToggleButton) findViewById(checkedId); Toast.makeText(getApplicationContext(), tab.getText() + " selected", Toast.LENGTH_SHORT).show(); } }