Back to project page Joetz-Android-V2.
The source code is released under:
GNU General Public License
If you think the Android project Joetz-Android-V2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.jens.myapplication.activities; /*from ww w . ja va2 s.co m*/ import android.app.Activity; import android.app.ActionBar; import android.app.Fragment; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.support.v7.app.ActionBarActivity; import android.util.Log; import android.view.LayoutInflater; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import android.os.Build; import com.example.jens.myapplication.R; import com.example.jens.myapplication.apimanager.manager.ActivityManager; import com.example.jens.myapplication.sam.JoetzApplication; /** * Activity for the detail page of an activity */ public class ActivityDetailActivity extends FragmentActivity implements ActivityDetailFragment.OnFragmentInteractionListener{ public static final String ARG_ACTIVITY_ID = "argActivityId"; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityManager manager = JoetzApplication.getContext().getActivityManager(); if(manager.getActivities() == null){ Log.w("ActivityDetail", "Activities are not loaded"); finish(); } setContentView(R.layout.activity_activity_detail); if (savedInstanceState == null) { Bundle extras = getIntent().getExtras(); if(extras == null || !extras.containsKey(ARG_ACTIVITY_ID)){ throw new IllegalArgumentException("Activity ID required, use extra ARG_ACTIVITY_ID"); } Fragment fragment = ActivityDetailFragment.newInstance(extras.getLong(ARG_ACTIVITY_ID)); getFragmentManager().beginTransaction() .add(R.id.container, fragment) .commit(); } } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { // This ID represents the Home or Up button. In the case of this NavUtils.navigateUpFromSameTask(this); return true; } return super.onOptionsItemSelected(item); } }