I have been working on this for quite a while and cannot seem to
figure it out. I am kind of new to android so Im not sure how it
works. I tried using

mTabHost.onPause();

which would bring up the tab and then the content inside it.

in the onPause class. But Im not sure What else to do. The application
keeps closing when using the back button as well. I guess Im not
understanding how to use this. I think its because I cant pass
mTabHost directly to the method. Im not sure how to pass it though.
Would love any help as I cannot figure this out to save my life. My
code is as follows.

package com.kellertcreations;

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

public class KellertCreationsActivity extends TabActivity {

    private TabHost mTabHost;
    TabHost.TabSpec spec;
    Intent intent;
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

  mTabHost = getTabHost();


  //Home Tab
  intent = new Intent().setClass(this,HomeActivity.class);

  spec = mTabHost.newTabSpec("home")
          .setIndicator("Home")
          .setContent(intent);
  mTabHost.addTab(spec);


//Packages Tab
  intent = new Intent(this,PackagesActivity.class);

  spec = mTabHost.newTabSpec("Packages")
          .setIndicator("Packages")
          .setContent(intent);
  mTabHost.addTab(spec);
//About Us Tab
  intent = new Intent(this,AboutUsActivity.class);

  spec = mTabHost.newTabSpec("")
          .setIndicator("About Us")
          .setContent(intent);
  mTabHost.addTab(spec);
//Contact Us Tab
  intent = new Intent(this,ContactUsActivity.class);

  spec = mTabHost.newTabSpec("contactus")
          .setIndicator("Contact Us")
          .setContent(intent);
  mTabHost.addTab(spec);

    }
}

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to