use of com.owncloud.android.ui.fragment.contactsbackup.BackupListFragment in project android by nextcloud.
the class ContactsPreferenceActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.contacts_preference);
// setup toolbar
setupToolbar();
// setup drawer
// setupDrawer(R.id.nav_contacts); // TODO needed?
// show sidebar?
boolean showSidebar = getIntent().getBooleanExtra(EXTRA_SHOW_SIDEBAR, true);
if (!showSidebar) {
setDrawerLockMode(DrawerLayout.LOCK_MODE_LOCKED_CLOSED);
if (getSupportActionBar() != null) {
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
}
if (mDrawerToggle != null) {
mDrawerToggle.setDrawerIndicatorEnabled(false);
}
}
Intent intent = getIntent();
if (savedInstanceState == null) {
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
if (intent == null || intent.getParcelableExtra(EXTRA_FILE) == null || intent.getParcelableExtra(EXTRA_USER) == null) {
BackupFragment fragment = BackupFragment.create(showSidebar);
transaction.add(R.id.frame_container, fragment);
} else {
OCFile file = intent.getParcelableExtra(EXTRA_FILE);
User user = intent.getParcelableExtra(EXTRA_USER);
BackupListFragment contactListFragment = BackupListFragment.newInstance(file, user);
transaction.add(R.id.frame_container, contactListFragment);
}
transaction.commit();
}
}
Aggregations