Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SuppressLint("NewApi")
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- setTheme(R.style.Theme_ColorScheme_Red);
- setContentView(R.layout.activity_main);
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
- TypedValue val = new TypedValue();
- getTheme().resolveAttribute(R.attr.designBase700, val, true);
- Window window = getWindow();
- window.addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS);
- window.clearFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS);
- window.setStatusBarColor(val.data);
- }
- /** skip those lines because they're not important **/
- if (savedInstanceState == null) {
- MainFragment frag = new MainFragment();
- Bundle bundle = new Bundle();
- bundle.putBoolean(MainFragment.BUNDLE_ARG_FIRST_START, true);
- frag.setArguments(bundle);
- getSupportFragmentManager().beginTransaction().add(R.id.container, frag, MainFragment.TAG).commit();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement