Android Open Source - rebudget Main Tab Activity






From Project

Back to project page rebudget.

License

The source code is released under:

Copyright (c) 2012, Alexander Lopatin All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are me...

If you think the Android project rebudget 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 com.sbar.rebudget.activities;
/*from w w w.ja  v a  2  s .  co  m*/
import android.app.TabActivity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

import com.sbar.rebudget.activities.PlansActivity;
import com.sbar.rebudget.activities.WalletsActivity;
import com.sbar.rebudget.activities.CategoriesActivity;
import com.sbar.rebudget.activities.StatsActivity;
import com.sbar.rebudget.Common;
import com.sbar.rebudget.database.DatabaseConnector;
import com.sbar.rebudget.receivers.SmsListener;
import com.sbar.rebudget.R;

public class MainTabActivity extends TabActivity {
    private TabHost m_tabHost = null;
    public static DatabaseConnector s_dc = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        if (s_dc == null) {
            s_dc = new DatabaseConnector(this);
            s_dc.open();
        }

        m_tabHost = getTabHost();
        createTab("Plans", R.drawable.icon_plans_tab, PlansActivity.class);
        createTab("Wallets", R.drawable.icon_wallets_tab, WalletsActivity.class);
        createTab("Categories", R.drawable.icon_stats_tab, CategoriesActivity.class);
        createTab("Stats", R.drawable.icon_stats_tab, StatsActivity.class);

        //SmsListener.readSms(this);
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        Common.LOGI("MainTabActivity.onDestroy");
        s_dc.close();
    }

    private void createTab(final String title, int iconId, Class<?> activityClass) {
        TabSpec spec = m_tabHost.newTabSpec(title);
        spec.setIndicator(title, getResources().getDrawable(iconId));
        Intent intent = new Intent(this, activityClass);
        spec.setContent(intent);
        m_tabHost.addTab(spec);
    }
}




Java Source Code List

com.sbar.rebudget.Common.java
com.sbar.rebudget.FilterStruct.java
com.sbar.rebudget.Pair.java
com.sbar.rebudget.activities.AddFilterCostActivity.java
com.sbar.rebudget.activities.AddFilterRemainingActivity.java
com.sbar.rebudget.activities.AddFilterStoreActivity.java
com.sbar.rebudget.activities.AddOutcomeFilterActivity.java
com.sbar.rebudget.activities.CategoriesActivity.java
com.sbar.rebudget.activities.MainTabActivity.java
com.sbar.rebudget.activities.PlansActivity.java
com.sbar.rebudget.activities.StatsActivity.java
com.sbar.rebudget.activities.WalletsActivity.java
com.sbar.rebudget.database.DatabaseConnector.java
com.sbar.rebudget.database.DatabaseHelper.java
com.sbar.rebudget.receivers.SmsListener.java
com.sbar.rebudget.views.ChartView.java