Android Studio App Development | Tabs for our App | Part 2

Share it with your friends Like

Thanks! Share it with your friends!


Hey Guys,
welcome to the second part of the Android Studio App Development Tutorials in Java.
Today we are adding a TabHost to our App and you will also see what we made so far.
Next time we will create the Contact List and our own Contact Class.

– Project Download –

Intro Song:
Robot Koch – Hard To Find


‫דורון פדר‬‎ says:

org.apache.commons.lang.StringUtils.isEmpty(String str) is better – will check also for null

Eliud Njuguna says:

the tutorial is great but can you increase the text size in the tutorial

sci-tech says:

Create tutorials. From long time I was trying to create my first app, but was not able to develop simple button click. Your tutorials are simple, easy . So keep continue so that people like me become able to dig into Android world. Thanks

Shankar Cute says:

dude tis tutorial s nice but where can i find an emulator can anyone tell where to download that emulator thing

Bibin Job says:

Thanks a lot. It worked very fine.

Computer Scientist says:

thank you for this tutorial … but there is one problem, if i swipe it does not work
if there is a way to solve this problem please tell me

justCiaranYT says:

Johnny, the contact is displaying in the contact creator page below where you enter the info, instead of displaying in the list tab, any fix for this?

Edward Duhig says:

Bro!! all i can say is don't be nervous in doing that thing because you are just sharing your knowledge its up to the people if they appreciated what you will be sharing to them but OVERALL!! BEST TUTORIAL even if its not for beginner but still for me I have a small experience about java programming I can say that this tutorial is useful for me 😀 TNX FOR THE TUTORIAL BRO!!

BKFactoryful says:

I've done everything as you have but my App crashed even before it started, as well, when my phone is plugged in (Because I don't like the Emulator) there are tons of Messages in the logcat and it doesnt stop sending more, unless I unplug my phone.

The App finds one mistake but I can't see the mistake. It's in this row :        
TabHost tabHost = (TabHost) findViewById(;
My id for the TabHost was tab1(I named it like this by myself) and the error says :
"Unexpectet cast to TabHost: layout tag was TabWidget
Keeps track of the view types associated with ids and if it finds a usage of the id in the Java code it ensures that it is treated as the same type."

I've got a broken english, so I can't understand this Error..Could someone explain what it means?

melculrapid says:

The method chain at the start is absolutely glorious! 
Java at it's finest right there…

Calvin Kwan says:

Thank you so much. So many other tutorials that worked with tabs were all depreciated. Thank you

Kaustubh Joshi says:

The order of copying the objects from linear layout could be preserved by simply holding down ctrl + click in order on objects

Mervin Vrolijk says:

Excellent tutorials man.. Funny guy too hahah… No homo.

Om Prakash says:

I want some good videos for multiple screen compatibility,plz help me to find one.

hahgayyyyyy says:

Couldn't we just say addBtn.setEnabled(name.length() !=0); ? In my case it works. When I type something the button is being enabled.

David Buckley says:

Thank god another c# developer it helps allot to no that you from same background watching this as first video

LogicOwlGaming says:

Oh, man, dude, you have no idea how awesome this is. I've been programming in various things for 2.5 years now, and I've recently decided to focus my career on Android. As such, I've been trying to find good tutorials that use Android Studio as the IDE, and I found a few, but then I started following a tutorial of a guy who was using Eclipse, and that caused issues, to say the least. Out of the four apps that I made following his tutorial, only one worked, and that was because of a modification that I made to change how the events were driven. That, and he had an awful habit of making THE ENTIRE app before testing any of it. Whereas you, you're using Android Studio, and you test your app as you go! Thanks so much! :D

_CJPayne_ says:

I've watched a good few of these tutorials, but none that made as much sense as this one did. I didn't expect much, but I followed along, copied what you did and my App works – plus, I actually KNOW what you did and understand it. Thanks so much. I'm now going to watch more of them! Thumbs up :)

enjoy says:

Always getting Error Messages yay! … Don't even want to try it again now, 'cause it won't work anyways :/

Amir Golan says:

I'm following you tutorials and suddenly the display window has disappeared and won't come back. It works on other projects of mine, but just not on this one. I can press on the design tab, but the preview is not there, and in tools->..preview I cannot choose this option (which is there).
Do you know what it could be?

Thanks a lot!

Umar Farooq says:

Well explained tutorials. Thanks a lot! :)

malakobasica says:

Amazing, Google has something to learn here. They need to take their documentation down a notch so that new developers can understand it too.. Thanks for this!

walaoRIKI - Teoh says:

Thanks for your tutorial :D

Jayvee T. Valenzuela says:

man your naming was horrible, but thanks for the tutorial anyway.

lemmeaskok says:

nice tutorial

Ayaz Muhammed says:

thanx for the tutorial its very plain and simple . thank you 

Lee Jamison says:

Just stopping by to say thank you SO much! I've spent the past month trying to find an updated tutorial on how to set tabs (without using deprecated methods) and you've solved it! :)

Write a comment