/* * This file is part of the Remote Sensor Actuator Interface (ReSAI). * * Copyright(c) Andreas Kipp, Frederic Siepmann * http://opensource.cit-ec.de/projects/resai * * This file may be licensed under the terms of of the * GNU Lesser General Public License Version 3 (the ``LGPL''), * or (at your option) any later version. * * Software distributed under the License is distributed * on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either * express or implied. See the LGPL for the specific language * governing rights and limitations. * * You should have received a copy of the LGPL along with this * program. If not, go to http://www.gnu.org/licenses/lgpl.html * or write to the Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * The development of this software was supported by the * Excellence Cluster EXC 277 Cognitive Interaction Technology. * The Excellence Cluster EXC 277 is a grant of the Deutsche * Forschungsgemeinschaft (DFG) in the context of the German * Excellence Initiative. * */ /** * Manager controlling tab activities. * * @author akipp */ package de.unibi.airobots.resaidroid; import android.app.TabActivity; import android.content.Intent; import android.os.Bundle; import android.widget.TabHost; import de.unibi.airobots.resaidroid.communication.Communicator; import de.unibi.airobots.resaidroid.communication.XmppConnection; import de.unibi.airobots.resaidroid.tabactivities.TabConfig; public class TabManager extends TabActivity { private static final String TAG = "TabManager"; private Communicator com = new XmppConnection(); public Communicator getCom() { return com; } public void setCom(Communicator com) { this.com = com; } public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.tabhost); //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 configuration tab intent = new Intent().setClass(this, TabConfig.class); spec = tabHost.newTabSpec("config").setIndicator(" Status ") .setContent(intent); tabHost.addTab(spec); } @Override protected void onPause() { super.onPause(); if(com.isConnected()) { com.disconnect(); com.setConnectedToReSAI(false); } } }