Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@iZiMO
Last active December 15, 2017 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save iZiMO/baa1f33f6befc3b9f72e849d6a4c4ada to your computer and use it in GitHub Desktop.
Save iZiMO/baa1f33f6befc3b9f72e849d6a4c4ada to your computer and use it in GitHub Desktop.
Set activity theme based on card category
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