Back to project page Android102.
The source code is released under:
MIT License
If you think the Android project Android102 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.myfamily; //from ww w.j a va 2s . co m import android.content.Intent; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.view.MenuItem; public class PersonDetailActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_person_detail); getActionBar().setDisplayHomeAsUpEnabled(true); if (savedInstanceState == null) { Bundle arguments = new Bundle(); arguments.putString(PersonDetailFragment.ARG_ITEM_ID, getIntent().getStringExtra(PersonDetailFragment.ARG_ITEM_ID)); PersonDetailFragment fragment = new PersonDetailFragment(); fragment.setArguments(arguments); getSupportFragmentManager().beginTransaction() .add(R.id.person_detail_container, fragment) .commit(); } } @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == android.R.id.home) { NavUtils.navigateUpTo(this, new Intent(this, PersonListActivity.class)); return true; } return super.onOptionsItemSelected(item); } }