Java tutorial
/* * Copyright (C) 2013 - Gareth Llewellyn * * This file is part of the Unofficial HackedIO Android App https://github.com/NetworksAreMadeOfString/HackedIO-Android-App * * This app is unofficial. The "Hacked.io" logo is copyright (and maybe even a trademark of) Telefnica UK Limited. * The author of this app is not affiliated with Telefnica UK Limited, The Lab ( https://thelab.o2.com/ ) or * Geeks of London ( http://geeksoflondon.com/ ) although the author <strong>is</strong> an attendee. * * This program is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. * * You should have received a copy of the GNU General Public License along with * this program. If not, see <http://www.gnu.org/licenses/> */ package app.hacked; import android.app.ActionBar; import android.os.Bundle; import android.support.v4.app.FragmentActivity; public class ScheduleListItemDetailActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_schedule_detail); final ActionBar actionBar = getActionBar(); actionBar.setSubtitle("This app is UNOFFICIAL use at your own risk"); actionBar.setDisplayHomeAsUpEnabled(true); // savedInstanceState is non-null when there is fragment state // saved from previous configurations of this activity // (e.g. when rotating the screen from portrait to landscape). // In this case, the fragment will automatically be re-added // to its container so we don't need to manually add it. // For more information, see the Fragments API guide at: // // http://developer.android.com/guide/components/fragments.html // if (savedInstanceState == null) { // Create the detail fragment and add it to the activity // using a fragment transaction. Bundle arguments = new Bundle(); arguments.putString(ScheduleItemDetailFragment.SCHEDULETITLE, getIntent().getStringExtra(ScheduleItemDetailFragment.SCHEDULETITLE)); arguments.putString(ScheduleItemDetailFragment.SCHEDULEID, getIntent().getStringExtra(ScheduleItemDetailFragment.SCHEDULEID)); arguments.putString(ScheduleItemDetailFragment.SCHEDULEFULLDATAHTML, getIntent().getStringExtra(ScheduleItemDetailFragment.SCHEDULEFULLDATAHTML)); arguments.putString(ScheduleItemDetailFragment.SCHEDULESTARTTIME, getIntent().getStringExtra(ScheduleItemDetailFragment.SCHEDULESTARTTIME)); arguments.putString(ScheduleItemDetailFragment.SCHEDULEDESC, getIntent().getStringExtra(ScheduleItemDetailFragment.SCHEDULEDESC)); arguments.putBoolean(ScheduleItemDetailFragment.ISDAYTITLE, getIntent().getBooleanExtra(ScheduleItemDetailFragment.ISDAYTITLE, false)); arguments.putString(ScheduleItemDetailFragment.SCHEDULEENDTIME, getIntent().getStringExtra(ScheduleItemDetailFragment.SCHEDULEENDTIME)); arguments.putBoolean(ScheduleItemDetailFragment.ARG_2PANE, getIntent().getBooleanExtra(ScheduleItemDetailFragment.ARG_2PANE, false)); ScheduleItemDetailFragment fragment = new ScheduleItemDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().replace(R.id.ScheduleDetails, fragment).commit(); } } }