
I need to use segmented control in Android. Is there a default control for the same? What might be the best and efficient way to do so?

I need to use segmented control in Android. Is there a default control for the same? What might be the best and efficient way to do so?
This will work:
<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/padding_extreme"
android:stretchColumns="*">
<TableRow
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/padding_very_less"
android:background="@color/colorBlack"
android:padding="@dimen/padding_very_less">
<TextView
android:id="@+id/seg_one"
style="@style/barGrapButtons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="0dp"
android:background="@color/colorBlack"
android:text="SegmentOne"
android:textColor="@color/colorWhite" />
<TextView
android:id="@+id/seg_two"
style="@style/barGrapButtons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SegmentTwo" />
<TextView
android:id="@+id/seg_three"
style="@style/barGrapButtons"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="SegmentThree" />
</TableRow>
</TableLayout>
res/values/styles.xml
<style name="barGrapButtons">
<item name="android:textColor">@color/colorBlack</item>
<item name="android:textSize">@dimen/small_text</item>
<item name="android:gravity">center|center_horizontal</item>
<item name="android:clickable">true</item>
<item name="android:padding">@dimen/padding_five_dp</item>
<item name="android:background">@color/colorWhite</item>
<item name="android:layout_marginLeft">1dp</item>
</style>
I guess you are speaking about fragments with tabs on the top. There will be many answers if you search for Tabbed Activity. However, a simple way to start off with is
Right-click in the package - > New -> Activity - > Tabbed Activity
An activity with tabs and fragments will be automatically created which works as the flow which you have shown in the image.