title: Android Segmented Radio Button
body: <p><img src="https://i.stack.imgur.com/jiFbW.png" alt="enter image description here"></p>
  
  <p>I have imported this method from <a href="https://github.com/makeramen/android-segmentedradiobutton" rel="nofollow noreferrer">https://github.com/makeramen/android-segmentedradiobutton</a>.
  how to display a Views(may be Listview,Imageview or whatever) when each button is clicked.</p>
  
  <p>here is the code..</p>
  
  <pre><code>    @Override
  public void onCheckedChanged(RadioGroup group, int checkedId) {
      // TODO Auto-generated method stub
      if (group == segmentText) {
          if (checkedId == R.id.button_one) {
  
              Toast.makeText(getApplicationContext(), "Featured",
                      Toast.LENGTH_SHORT).show();
          } else if (checkedId == R.id.button_two) {
  
              Toast.makeText(getApplicationContext(), "NearBy",
                      Toast.LENGTH_SHORT).show();
          } else if (checkedId == R.id.button_three) {
              Toast.makeText(getApplicationContext(), "Whatsup",
                      Toast.LENGTH_SHORT).show();
          }
      }
  }
  </code></pre>