-3

I am developing an app and I wanted to have a TabView for it. Although I've been looking around and around and I can't find any help for it in Java code. All of the help is in XML. My university only taught us the Java portion. Does anybody have a good guide or some good help that I can use to make TabView in java code?

1 Answers1

4

I am developing an app and I wanted to have a TabView for it.

There is no TabView in Android.

Although I've been looking around and around and I can't find any help for it in Java code.

Here are the JavaDocs for TabHost and the JavaDocs for TabWidget.

All of the help is in XML.

There is no XML shown on either of the JavaDocs pages.

Most programmers would use layout XML resources for their GUI development, for ease of development and maintenance, particularly for supporting different screen sizes and orientations. You can certainly create these objects via their constructors, then use addView() to stitch them together. However, since very few developers would use this technique, it is unlikely that you will find much sample code for doing it this way.

My university only taught us the Java portion.

Anyone teaching Android application development without teaching layout XML resources needs to be fired for incompetence. When I teach Android application development, layout XML resources show up in the second or third hour of lecture, and it used to be earlier than that.

Does anybody have a good guide or some good help that I can use to make TabView in java code?

You would be better served taking the time to learn layout XML resources on your own. There are many, many resources for doing this, and it will help you better understand all the rest of the sample code that resides on the Android developer site and elsewhere.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491