title: How to create curved or rounded tabs in Android
body: <p>I want to show the curve at the bottom right side of my tabs. So how can it be done? Below is the code I have used for XML and Java files.</p>
  <p><strong>Code for first XML</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  
  &lt;TabHost xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
      android:id=&quot;@android:id/tabhost&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;&gt;
      &lt;LinearLayout
      android:orientation=&quot;vertical&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;&gt;
      &lt;TabWidget
      android:id=&quot;@android:id/tabs&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;wrap_content&quot;/&gt;
      &lt;FrameLayout
      android:id=&quot;@android:id/tabcontent&quot;
      android:layout_width=&quot;fill_parent&quot;
      android:layout_height=&quot;fill_parent&quot;/&gt;
      &lt;/LinearLayout&gt;
   &lt;/TabHost&gt;     
  </code></pre>
  <p><strong>Code for second XML</strong></p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;selector xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
  &lt;!-- When selected, use grey --&gt;
  
  &lt;item android:drawable=&quot;@drawable/ic_tab_artists_white&quot;
        android:state_selected=&quot;true&quot; 
        android:state_pressed=&quot;false&quot; /&gt;
  &lt;!-- When not selected, use white--&gt;
  &lt;item android:drawable=&quot;@drawable/ic_tab_artists_grey&quot; /&gt;
  &lt;/selector&gt;
  </code></pre>
  <p><strong>Code for .java file</strong></p>
  <pre><code>                Resources res = getResources(); 
                  final TabHost MainTabHost = getTabHost();  
                  TabHost.TabSpec spec; 
                  Intent intent; 
                  
                  MainTabHost.getTabWidget().setStripEnabled(false);
                  
                  //call calendar Activity class
                  intent = new Intent().setClass(this, CalendarForm.class);
                  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  spec = MainTabHost.newTabSpec(res.getString(R.string.text_tabHost1)).setIndicator(&quot;Calendar&quot;,
                  res.getDrawable(R.drawable.calendar_ic)).setContent(intent);
                  
                  MainTabHost.addTab(spec);
                  
                  //call History Activity class
                  intent = new Intent().setClass(this, HistoryForm.class);
                  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  spec = MainTabHost.newTabSpec(res.getString(R.string.text_tabHost2)).setIndicator(&quot;History&quot;,
                  res.getDrawable(R.drawable.calendar_ic)).setContent(intent);
                  MainTabHost.addTab(spec);
          
                  //call Statistic Activity class
                  intent = new Intent().setClass(this, StatisticForm.class);
                  intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                  spec = MainTabHost.newTabSpec(res.getString(R.string.text_tabHost3)).setIndicator(&quot;Statistic&quot;,
                  res.getDrawable(R.drawable.calendar_ic)).setContent(intent);
                  MainTabHost.addTab(spec);
                  
                  //setbackground Style of tabHost                                       
                  MainTabHost.setCurrentTab(0); 
                  MainTabHost.getTabWidget().setWeightSum(3);
                  final TabWidget tabHost=getTabWidget();   
                  MainTabHost.setBackgroundResource(R.drawable.back_image);
                  
                  for (int j = 0; j &lt; MainTabHost.getTabWidget().getChildCount(); j++) 
                  {
                      ((TextView)tabHost.getChildAt(j).findViewById(android.R.id.title)).setTextColor(Color.parseColor(&quot;#FFFFFF&quot;));
                      ((TextView)tabHost.getChildAt(j).findViewById(android.R.id.title)).setTextSize(16);
                  }   
  </code></pre>
  <p><img src="https://i.stack.imgur.com/nIfNU.png" alt="enter image description here" /></p>
  <p>This is what I got. Here, tabs are square. Now I want my tabs curve at the bottom right side</p>