Last active
December 15, 2017 07:16
-
-
Save iZiMO/baa1f33f6befc3b9f72e849d6a4c4ada to your computer and use it in GitHub Desktop.
Set activity theme based on card category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CardDetailActivity extends AppCompatActivity { | |
public static final String EXTRA_CARD = "card"; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Card card = getIntent().getParcelableExtra(EXTRA_CARD); | |
setTheme(card.category.getThemeId()); | |
// inflate views | |
// ... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment