Android Application Development Tutorial - 85 - Setting up the TabHost in Java

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

once again even though outdated, this guide has helped me accomplish alot... now that tabactivity is deprecated and fragments is too complex for me this guide is my only way

madarasems
Автор

thank you for teaching me! I am beginner, not a master in java, but learnign both android and java at the same time! :)

criticalmoorhen
Автор

tabs in the new API look way more sleek! :D

ApuTube
Автор

If the tabs aren't filling up the entire width, make sure your layout_width for TabWidget is set to "match_parent" and the layout_height is set to "wrap_content".

debayandeb
Автор

Make sure your height and width is fill_parent or match_parent for everything to get it to space out. Ur tabwidget height is the only wrap_content. Also it cannont be viewed on graphical layout only on a device like a emulator. Thumbs up for others to see.

_blank
Автор

Nice it works for me. Thanks man. 1 question though, if I want a scroll view for every tab should I put <ScrollView> between <tabWidget> and <frameLayout> or is it inside every <LinearLayout>

marccalvinlimbo
Автор

Thanks for this tutorial man! I have a question. Whenever i change the screen orientation the app reverts back to the dafault tab. For example.

I have 3 tab namely tab 1(default tab), tab 2, tab 3 and currently I am at tab 2, once I change the screen orientation the app reverts back to the default tab which is tab 1. My goal here is to retain the current selected tab whenever I change the screen orientation.

TIA

mexicanmoustache
Автор

you can set the color this way ( after you paste it, import the Color class)
int i = 0;

rumatom
Автор

so i have a question. I'm create android application i want to start new activity from OnClickListener button but it doesn't start activity you can help me ?

PanDoRaRoi
Автор

Instead of blindingly following travis, who now creates the variables outside the onCreate() method so that it can be accessed publicly? :)

mkab
Автор

how about making the tabs change based on spinner selection??

TwisteddxGamerr
Автор

I got an error while working out with 85th tutorial. It is sudden and unexpected error,

R.java was modified manually! Reverting to generated version!

please help me.

sriankam
Автор

What if you wanted to use an icon instead of text as an Indicator?

TheSlehmann
Автор

is anyone else having the tabs activity showing up in a little cube on the emulater instead of filling the whole screen? I assume ive got an issue with one to many LinearLayouts or something but i cant figure it out

DjWuh
Автор

for some reason it can't find the id "tabhost", when i write "R.id.tabhost". but it is able to find the actual tabs, as in tab1, tab2, tab3. anyone experiencing this problem?

neemaXdinosaurad
Автор

Hey I tried this but It only seems to color the first tab, no matter where I paste this code! how do I color the 2nd or 3rd tabs?

jellars
Автор

what if the content is huge and we cant put in same layout?

fahadmullaji
Автор

yes it shows up the same way on my phone. all the buttons and tabs work its just smashed up really little in the middle of the screen

DjWuh
Автор

I can't really figure out what's the point of setting up this stuff in Java rather than in XML.

small_bytes
Автор

damn emulator, gives me null! guys do you think i should ignore running and just follow along to get the conepts or should i fix it? it seems pretty hard to track -- it doesnt give me where the error occurs. i miss printStackTace()

Sccoropio