Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class RecipeActivity extends AppCompatActivity {
- private Recipe mRecipe = null;
- @Override
- public void onCreate(@Nullable Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- // Supporting going back to the list of recipes.
- if (getSupportActionBar() != null) {
- getSupportActionBar().setDisplayHomeAsUpEnabled(true);
- }
- // Determine if the activity is started from another, thus try to parse the activity desired
- // extras.
- Intent intent = getIntent();
- if (intent != null && intent.hasExtra(getString(R.string.key_recipe))) {
- this.mRecipe = intent.getParcelableExtra(getString(R.string.key_recipe));
- }
- if (this.mRecipe != null) {
- setTitle(this.mRecipe.getName());
- }
- }
- }
Add Comment
Please, Sign In to add comment