Back to project page yellowpages-android-tdd.
The source code is released under:
MIT License
If you think the Android project yellowpages-android-tdd 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.tddrampup.activities; /*from w w w . jav a 2 s. c om*/ import android.content.Intent; import android.net.Uri; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.support.v4.app.NavUtils; import android.view.MenuItem; import com.tddrampup.R; import com.tddrampup.contentprovider.ListingContentProvider; import com.tddrampup.fragments.DetailFragment; public class DetailActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.detail_activity); getActionBar().setDisplayHomeAsUpEnabled(true); if (savedInstanceState == null) { // Create the detail fragment and add it to the activity // using a fragment transaction. Uri uri = getIntent().getExtras().getParcelable(ListingContentProvider.CONTENT_ITEM_TYPE); DetailFragment fragment = new DetailFragment(uri); getSupportFragmentManager().beginTransaction() .add(R.id.item_detail_container, fragment) .commit(); } } @Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); if (id == android.R.id.home) { NavUtils.navigateUpTo(this, new Intent(this, MainActivity.class)); return true; } return super.onOptionsItemSelected(item); } }