Simulate a Tab Host with ActionButtons

Introduction
In this tutorial, you will learn how to simulate a TabHost bar with Layouts and ActionButtons. You will also learn how to receive the inputs of the buttons and how to make them look like they are activated.

Dependencies
Import the following dependencies:

Now create as many buttons inside the LinearLayout as you like. Make their widths match_parent and their weight to 1. Set their style to Widget.Holo.ActionButton. If you are only supporting Android 5+, you can use Widget.Material.ActionButton. Set all their onClick events to the same method. In this tutorial, I'll use the method tabClick. Set their ids to different names, but keep it organized

When you finish, your layout should look like this:

Conclusion
Your activity now has a simulated TabHost to handle a diversity of needs.

You now know how to simulate a TabHost bar. You also know how to receive inputs from the buttons with simple code and how to make them look like they are activated.