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 ChallengeDetailsActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.challenge_details_activity); // Set up the action bar. final ActionBar actionBar = getActionBar(); getActionBar().setIcon(R.drawable.ic_ab_logo); getActionBar().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(ChallengeDetailsFragment.TITLE, getIntent().getStringExtra(ChallengeDetailsFragment.TITLE)); arguments.putString(ChallengeDetailsFragment.DETAILS, getIntent().getStringExtra(ChallengeDetailsFragment.DETAILS)); arguments.putBoolean(ProjectDetailsFragment.ARG_2PANE, getIntent().getBooleanExtra(ProjectDetailsFragment.ARG_2PANE, false)); ChallengeDetailsFragment fragment = new ChallengeDetailsFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction().replace(R.id.ChallengeDetails, fragment).commit(); } } }