calling service using Tab activity Android
<p>am bit confused with tab activity, i have 3 tabs on my main view, and i can switch views using tabs, like main to courses or courses to main ,</p>

<p>but i want to call different services for each tab, like</p>

<ol>
<li>Tab 1 (Call) :  When a user clicks it, it will make a Call to a number "88888888888"</li>
<li>Tab 2 (Email) :  When a user clicks it, it will take user straight to "Compose new email" and passing     values like "aaaaaaa@aaa.com"</li>
<li>Tab 3 (Web) : when a user clicks it, it will open a browser with "www.helpme.co.uk"</li>
</ol>

<p>my current java and xml file coding is given below,</p>

<p>Java Code :</p>

<pre><code>package com.NVT.android;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

public class MainTabActivity extends TabActivity{

        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.tab_activity_layout);

            Resources res = getResources(); // Resource object to get Drawables
            TabHost tabHost = getTabHost();  // The activity TabHost
            TabHost.TabSpec spec;  // Resusable TabSpec for each tab
            Intent intent;  // Reusable Intent for each tab

            // Create an Intent to launch an Activity for the tab (to be reused)
            intent = new Intent().setClass(this, Main.class);

            // Initialize a TabSpec for each tab and add it to the TabHost
            spec = tabHost.newTabSpec("main").setIndicator("Main",
                              res.getDrawable(R.drawable.ic_tab_artists_grey))
                          .setContent(intent);
            tabHost.addTab(spec);

            // Do the same for the other tabs
            intent = new Intent().setClass(this, Courses.class);
            spec = tabHost.newTabSpec("courses").setIndicator("Courses",
                              res.getDrawable(R.drawable.ic_tab_artists_white))//m using same buttons for each tab u can change it by adding new drawable xml.. got that
                          .setContent(intent);
            tabHost.addTab(spec);

            intent = new Intent().setClass(this, Courses.class);
            spec = tabHost.newTabSpec("courses").setIndicator("Courses",
                              res.getDrawable(R.drawable.ic_tab_artists_white))//m using same buttons for each tab u can change it by adding new drawable xml.. got that
                          .setContent(intent);
            tabHost.addTab(spec);



        }
    }
</code></pre>

<p>XML Coding</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/tabhost"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
    &lt;LinearLayout
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:padding="5dp"&gt;
    &lt;RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    &gt;

        &lt;TabWidget
            android:id="@android:id/tabs"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"
             /&gt;
                  &lt;FrameLayout
            android:id="@android:id/tabcontent"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:padding="5dp"&gt;&lt;/FrameLayout&gt;

    &lt;/RelativeLayout&gt;
    &lt;/LinearLayout&gt;
&lt;/TabHost&gt;
</code></pre>
