Has anyone tried the tutorials in the "Android Developers" website?

First of all, I have to say that I find the site motivating enough to get me started with Android development.

I have some background, mediocre I would say, from university but never actually put it to use outside academic limits.

So to get started I thought “what better place to start than the official tutorials?”

I am trying to implement this tutorial:Android developers.

Basically, it’s just a tab layout with 3 tabs (Artists,Albums and Songs), an icon for each of the tabs and some text for the content of each tab.

While I have managed to make it run successfully, in the outcome it doesn’t display any of the icons that is supposed to show. The rest is ok.

Has anyone tried it?

I haven’t tried this tutorial in particular, but I’ve played around with some of the Android Developer sample code and found it generally quite helpful.

Regarding your particular problem, there are a lot of little things which could be wrong, so it’s hard to work out the issue without seeing some code. Maybe you’re using the same drawable (@drawable/ic_tab_artists_grey) for both selected and un-selected state? What happens when you click on a tab?

Hi michailangelo,

As David said, it is very difficult to know the problem without seeing what in you various folders. I quickly tried the tutorial to see if there are any issues but all is fine. I run it with the same drawable images provided in the tutorial and the images are visible on both selected and unselected states. I have attached a zipped sample of the project if you need to counter check.
[attachment=99]

TabHostWidget.zip (76.9 KB)

That’s not the case. When I click on a tab, it just goes to the particular tab.

Ok, I changed my manifest file to match yours (the only difference is that I use 15 as minSDKVersion) but still nothing.

Here is the code

HelloTabWidget.zip (153 KB)

Hey, I downloaded your project and everything seems to be okay. So i really don’t understand your problem. Please specify your actual problem, steps you do so as to help reproduce the same scenario, what you expected and finally what you really get(in this case undesired results). This way it will be easier to assist you.

I figured what the problem is.

I don’t know why but when you build the app on android 4.0.3 the icons just don’t show up. Instead, I put build target android 3.2 and all worked just as you guys said.

Strange.

I also didn’t know about this but when i checked around i realised you are not alone. One person asked the same question on stackoverflow but no one replied. http://stackoverflow.com/questions/8192708/images-used-for-tabs-not-visible-android-4-0. My guess would be that it is due to the fact that TabActivity is deprecated(i stand corrected), and it is advised to use fragments to to create tabbed interface and hence the way to go is to use Action bars. If you are really interested in this then you can find nice tutorials below on working with fragments.

  1. http://developer.android.com/resources/samples/Support4Demos/src/com/example/android/supportv4/app/FragmentTabs.html
  2. http://mobile.tutsplus.com/tutorials/android/android-compatibility-working-with-fragments/
  3. http://www.abelski.com/courses/android3ui/actionbar.pdf

Regards.

Thanks Babuye.

Now, I’ll move forward to the Notepad tutorial.