Android 3.0 Action Bar Tabs

life michael · 21K views · 2011 · 2:29

Open on YouTube

Software practice, open source & careersSoftware (other)tutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it as the tutorial they followed when setting up Action Bar tabs with fragments and then got stuck on runtime errors, view access, or adding icons.

Recommended by 0 people across 0 different months, 2011 to 2012.

What it is

A short 2.5-minute screencast from 2011 showing how to build tab navigation with the Android 3.0 (Honeycomb) Action Bar, where each tab switches between fragments and can have an icon, a title, or both. It is a hands-on code walkthrough by an individual developer.

What people said

Cites simplified. · 2011-06 · Stack Overflow · on “Android Tab Action Bar”

I am trying out on the android action bar for 3.0, where I refer to [this video] The code in the TabsActivity are as follow: package com.test.actionbar; import android.app.ActionBar; import android.app.ActionBar.Tab; import android.app.Activity; import android.app.Fragment; import android.app.FragmentTransaction; import android.os.Bundle; public class TabsActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActionBar bar = getActionBar(); bar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS); ActionBar.Tab tabA = bar.newTab().setText("A Tab"); ActionBar.Tab tabB = bar.newTab().setText("B Tab"); ActionBar.Tab tabC = bar.newTab()

Cites simplified. · 2011-06 · Stack Overflow · on “Android Action Bar - With Tabs”

@Suchi i am running it on a android 3.0 tablet. i referred to a tutorial on youtube [this video] but i am having run time exceptions.

Cites tway · 2011-09 · Stack Overflow · on “Programmatically accessing a view that is defined in a fragment's XML in Android”

I'm in the process of making an Android 3 app that has a tab-based navigation. Being quite new to Android I searched for tab tutorials and found a few different approaches, out of which an implementation based on Fragments + ActionBar seemed to be the best. I followed these tutorials [LINK] (the last few slides) and [this video] (same lesson in video format) ...and got to the point where the tabs show up, I can switch between them OK, and simple TextViews inside them show up fine. Now, problems arise when I want one of the tabs to have a spinner widget that is defined in the fragment's XML file and populate it with items that are defined in the strings.xml file. When I try to access the spinner w

Cites user533844 · 2011-09 · Stack Overflow · on “Android ActionBar Tab Navigation”

I am following [this video] example. Setting up the tabs is working fine. On each tab, I am using a cursor to get the data from SQLite and display it. where should I write that code ? In TabActivity ? In AFragmentTab ?

Cites noloman · 2012-04 · Stack Overflow · on “Android: tabs within tabs”

I found this, thanks to the ActionBar (and SherlockActionBar for pre-Honeycomb devices): [LINK] and also this: [this video]

Cites anders · 2012-11 · Stack Overflow · on “How to add an icon to actiontab”

Hi I have followed the tutorial below exactly and now I'm wondering how I can add an icon to each tab? I only know how to add an icon to a menu but not a tab. Also I'm new to android, so it would be awsome if someone could tell me exactly where the android:icon="@drawable/ic_action_view_as_list" should go. As it is now it is only adding the Text with the argument ActionBar.Tab tabB = bar.newTab().setText("Summary"); but I also want for example tabB to have the android:icon="@drawable/ic_action_view_as_list" here is the tutorial [this video] and here [LINK] Thanks