Android Open Source - T-CEP-Alert Main Activity






From Project

Back to project page T-CEP-Alert.

License

The source code is released under:

MIT License

If you think the Android project T-CEP-Alert listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package org.ruscoe.tcepalert;
//  ww w .  j a v  a  2  s .c o  m
import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

/**
 * The first activity displayed by the application. Creates a set of tabs,
 * allowing the user to navigate through all the application features.
 * 
 * @author Dan Ruscoe
 */
public class MainActivity extends TabActivity
{
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
      super.onCreate(savedInstanceState);
      
      setContentView(R.layout.main);
      
      Resources res = getResources();
      
      TabHost tabHost = getTabHost();
      TabHost.TabSpec spec;
      Intent intent;

      intent = new Intent().setClass(this, LatestAlertsActivity.class);

      spec = tabHost.newTabSpec("alerts").setIndicator(getString(R.string.alerts),
          res.getDrawable(R.drawable.ic_tab_alerts)).setContent(intent);
      tabHost.addTab(spec);

      intent = new Intent().setClass(this, LinksActivity.class);
      spec = tabHost.newTabSpec("links").setIndicator(getString(R.string.links),
          res.getDrawable(R.drawable.ic_tab_links)).setContent(intent);
      tabHost.addTab(spec);
      
      intent = new Intent().setClass(this, SettingsActivity.class);
      spec = tabHost.newTabSpec("settings").setIndicator(getString(R.string.settings),
          res.getDrawable(R.drawable.ic_tab_settings)).setContent(intent);
      tabHost.addTab(spec);
      
      intent = new Intent().setClass(this, AboutActivity.class);
      spec = tabHost.newTabSpec("about").setIndicator(getString(R.string.about),
          res.getDrawable(R.drawable.ic_tab_about)).setContent(intent);
      tabHost.addTab(spec);

      tabHost.setCurrentTab(0);
    }
}




Java Source Code List

org.ruscoe.tcepalert.AboutActivity.java
org.ruscoe.tcepalert.AlertAdapter.java
org.ruscoe.tcepalert.AlertUpdateCheck.java
org.ruscoe.tcepalert.AlertView.java
org.ruscoe.tcepalert.AlertsActivity.java
org.ruscoe.tcepalert.LatestAlertsActivity.java
org.ruscoe.tcepalert.LinksActivity.java
org.ruscoe.tcepalert.MainActivity.java
org.ruscoe.tcepalert.SettingsActivity.java
org.ruscoe.tcepalert.constants.Constants.java
org.ruscoe.tcepalert.dao.AlertDAO.java
org.ruscoe.tcepalert.dao.AlertUpdateData.java
org.ruscoe.tcepalert.dao.CachedAlertData.java
org.ruscoe.tcepalert.dao.SettingsData.java
org.ruscoe.tcepalert.models.Alert.java
org.ruscoe.tcepalert.web.NetworkActivity.java
org.ruscoe.tcepalert.web.WebService.java