Example usage for android.support.v4.app FragmentManager enableDebugLogging

List of usage examples for android.support.v4.app FragmentManager enableDebugLogging

Introduction

In this page you can find the example usage for android.support.v4.app FragmentManager enableDebugLogging.

Prototype

public static void enableDebugLogging(boolean enabled) 

Source Link

Document

Control whether the framework's internal fragment manager debugging logs are turned on.

Usage

From source file:butter.droid.activities.MainActivity.java

@SuppressLint("MissingSuperCall")
@Override//from   w ww .  j av  a2s .c o m
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState, R.layout.activity_main);

    if (!PrefUtils.contains(this, TermsActivity.TERMS_ACCEPTED)) {
        startActivity(new Intent(this, TermsActivity.class));
    }

    if (ContextCompat.checkSelfPermission(this,
            Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) {
        ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE },
                PERMISSIONS_REQUEST);
    }

    String action = getIntent().getAction();
    Uri data = getIntent().getData();
    if (action != null && action.equals(Intent.ACTION_VIEW) && data != null) {
        String streamUrl = data.toString();
        try {
            streamUrl = URLDecoder.decode(streamUrl, "utf-8");
            StreamLoadingActivity.startActivity(this, new StreamInfo(streamUrl));
            finish();
            return;
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
    }

    FragmentManager.enableDebugLogging(BuildConfig.DEBUG);

    setSupportActionBar(mToolbar);
    setShowCasting(true);

    ToolbarUtils.updateToolbarHeight(this, mToolbar);

    // Set up the drawer.
    DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
    drawerLayout.setStatusBarBackgroundColor(getResources().getColor(R.color.primary_dark));

    mNavigationDrawerFragment = (NavigationDrawerFragment) getSupportFragmentManager()
            .findFragmentById(R.id.navigation_drawer_fragment);

    mNavigationDrawerFragment.initialise(mNavigationDrawerContainer, drawerLayout);

    if (null != savedInstanceState)
        return;
    int providerId = PrefUtils.get(this, Prefs.DEFAULT_VIEW, 0);
    mNavigationDrawerFragment.selectItem(providerId);
}

From source file:org.wheelmap.android.activity.MainSinglePaneActivity.java

@Override
public void onCreate(Bundle savedInstanceState) {

    getWindow().requestFeature(Window.FEATURE_ACTION_BAR);

    super.onCreate(savedInstanceState);

    setContentView(R.layout.activity_single_pane);

    appProperties = AppProperties.getInstance(WheelmapApp.getApp());
    Log.d(TAG, "onCreate");

    ActionBar actionbar = getSupportActionBar();
    if (actionbar != null) {
        actionbar.setHomeButtonEnabled(true);
        actionbar.setDisplayShowTitleEnabled(true);
        actionbar.setDisplayHomeAsUpEnabled(true);
    }//from w  w  w  .  j  ava 2  s. c  o  m

    flipper = (ViewFlipper) findViewById(R.id.flipper);
    flipper.setDisplayedChild(0);

    FragmentManager.enableDebugLogging(true);

    ActionBar actionBar = getSupportActionBar();
    actionBar.setDisplayShowTitleEnabled(false);
    View customNav = LayoutInflater.from(this).inflate(R.layout.actionbar, null);
    actionBar.setCustomView(customNav);

    FragmentManager fm = getSupportFragmentManager();
    FragmentTransaction t = fm.beginTransaction();

    mWorkerFragment = (CombinedWorkerFragment) fm.findFragmentByTag(CombinedWorkerFragment.TAG);
    if (mWorkerFragment == null) {
        mWorkerFragment = new CombinedWorkerFragment();
        t.add(mWorkerFragment, CombinedWorkerFragment.TAG);
    }

    mListFragment = (POIsListFragment) fm.findFragmentById(R.id.list_layout);
    if (mListFragment == null) {
        mListFragment = POIsListFragment.newInstance(false, true);
        t.add(R.id.list_layout, mListFragment, POIsListFragment.TAG);
    }

    mMapFragment = (POIsOsmdroidFragment) fm.findFragmentById(R.id.map_layout);
    if (mMapFragment == null) {
        mMapFragment = POIsOsmdroidFragment.newInstance(false, true);
        t.add(R.id.map_layout, mMapFragment, POIsOsmdroidFragment.TAG);
    }

    t.commit();

    if (savedInstanceState != null) {
        executeState(savedInstanceState);
    } else {
        executeDefaultInstanceState();
    }

    Bundle extras = getIntent().getExtras();
    if (extras.containsKey(Extra.MAP_MODE_ENGAGE)) {
        mapModeType = MapModeType.MAP_MODE_ENGAGE;
        MapActivityUtils.setWheelchairFilterToEngageMode(this);
    } else {
        mapModeType = MapModeType.MAP_MODE_NORMAL;
    }
}

From source file:net.v00d00.xr.HomeActivity.java

private void setRightPane(AbstractXRFragment f) {

    LinearLayout.LayoutParams params;/*from w w w. ja  v  a  2s .  com*/

    Log.d("IS TABLET", Boolean.toString(XRUtils.isTablet(this)));

    if (XRUtils.isTablet(this)) {
        params = new LinearLayout.LayoutParams((int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 640,
                getResources().getDisplayMetrics()), LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
    } else {
        rightPane.setVisibility(View.GONE);
        params = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.MATCH_PARENT,
                LinearLayout.LayoutParams.MATCH_PARENT, 1.0f);
    }
    params.leftMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 1,
            getResources().getDisplayMetrics());

    rightPane.setLayoutParams(params);

    FragmentManager fm = getSupportFragmentManager();
    FragmentManager.enableDebugLogging(true);
    if (!f.isAdded()) {
        if (XRUtils.isTablet(this))
            fm.beginTransaction().replace(R.id.right_pane, f).addToBackStack(null)
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commit();
        else {
            fm.beginTransaction().replace(R.id.left_pane, f).addToBackStack(null)
                    .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_OPEN).commit();
        }
    }

}