Code example for FragmentActivity

Methods: getWindow, onAttachedToWindow

1
        notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
    } 
     
    @Override 
    public void onAttachedToWindow() { 
        super.onAttachedToWindow(); 
        // Enable dithering, ie better gradients. 
        getWindow().setFormat(PixelFormat.RGBA_8888);
    } 
     
    @Override 
    public void onAttachFragment(Fragment fragment) {
        super.onAttachFragment(fragment);
        if (fragment instanceof EventDetailsFragment) {
            final Uri eventUri = getIntent().getData();
            if (eventUri == null) {
                Log.e(TAG, "Missing event URI");
            } else { 
                final EventDetailsFragment details = (EventDetailsFragment) fragment;
                details.setEvent(eventUri);
            }