Computer Science, asked by vsanskar1022, 10 months ago

How do I use tabHost for Android?

Answers

Answered by ritikaamlajiya
0

This example demonstrates how to use tab host in android.

Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.

Step 2 − Add the code to res/layout/activity_main.xml.

we have declared frame layout as Tab widget child (According to android.com it required frame layout as content for tab widget).

Step 3 − Add the code to src/MainActivity.java

Step 4 − No need to change manifest.xml file.

Let's try to run your application. I assume you have connected your actual Android Mobile device with your computer. To run the app from an android studio, open one of your project's activity files and click Run icon from the toolbar. Select your mobile device as an option and then check your mobile device which will display your default screen.

Now click on the second tab. it should give a result

I am unable to show you the codes

Please mark as brainliest

Similar questions