/* * Copyright 2012 Tallinn University Centre for Educational Technology * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ee.htk.dippler.app; import android.app.TabActivity; import android.content.Intent; import android.content.res.Resources; import android.os.Bundle; import android.widget.TabHost; import android.widget.TabHost.TabSpec; public class CourseSingleActivity extends TabActivity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); //This intent has course ID and session KEY in it for reque Intent passed_intent = getIntent(); Resources resources = getResources(); TabHost tabHost = getTabHost(); // Android tab Intent intentNews = new Intent().replaceExtras(passed_intent).setClass(this, NewsActivity.class); TabSpec tabSpecNews = tabHost .newTabSpec("dippler-news") .setIndicator(getString(R.string.tab_news), resources.getDrawable(R.drawable.news)) .setContent(intentNews); Intent intentTasks = new Intent().replaceExtras(passed_intent).setClass(this, TasksActivity.class); TabSpec tabSpecTasks = tabHost .newTabSpec("dippler-tasks") .setIndicator(getString(R.string.tab_tasks), resources.getDrawable(R.drawable.tasks)) .setContent(intentTasks); Intent intentGrades = new Intent().replaceExtras(passed_intent).setClass(this, GradesActivity.class); TabSpec tabSpecGrades = tabHost .newTabSpec("dippler-grades") .setIndicator(getString(R.string.tab_grades), resources.getDrawable(R.drawable.grades)) .setContent(intentGrades); Intent intentComments = new Intent().replaceExtras(passed_intent).setClass(this, CommentActivity.class); TabSpec tabSpecComments = tabHost .newTabSpec("dippler-comments") .setIndicator(getString(R.string.tab_comments), resources.getDrawable(R.drawable.comments)) .setContent(intentComments); Intent intentActivies = new Intent().replaceExtras(passed_intent).setClass(this, ActivitesActivity.class); TabSpec tabSpecActivites = tabHost .newTabSpec("dippler-activites") .setIndicator(getString(R.string.tab_activities), resources.getDrawable(R.drawable.activities)) .setContent(intentActivies); tabHost.addTab(tabSpecNews); tabHost.addTab(tabSpecTasks); tabHost.addTab(tabSpecGrades); tabHost.addTab(tabSpecComments); tabHost.addTab(tabSpecActivites); } }