use of androidx.fragment.app.FragmentManager in project android by nextcloud.
the class AuthenticatorActivity method showUntrustedCertDialog.
/**
* Show untrusted cert dialog
*/
private void showUntrustedCertDialog(RemoteOperationResult result) {
// Show a dialog with the certificate info
SslUntrustedCertDialog dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException) result.getException());
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(null);
dialog.show(ft, UNTRUSTED_CERT_DIALOG_TAG);
}
use of androidx.fragment.app.FragmentManager in project android by nextcloud.
the class ActivityInjector method onActivityCreated.
@Override
public final void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (activity instanceof Injectable) {
AndroidInjection.inject(activity);
}
if (activity instanceof FragmentActivity) {
final FragmentManager fm = ((FragmentActivity) activity).getSupportFragmentManager();
fm.registerFragmentLifecycleCallbacks(new FragmentInjector(), true);
}
}
use of androidx.fragment.app.FragmentManager in project android by nextcloud.
the class ReceiveExternalFilesActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
prepareStreamsToUpload();
if (savedInstanceState != null) {
String parentPath = savedInstanceState.getString(KEY_PARENTS);
if (parentPath != null) {
mParents.addAll(Arrays.asList(parentPath.split(OCFile.PATH_SEPARATOR)));
}
mFile = savedInstanceState.getParcelable(KEY_FILE);
}
mAccountManager = (AccountManager) getSystemService(Context.ACCOUNT_SERVICE);
super.onCreate(savedInstanceState);
// Listen for sync messages
IntentFilter syncIntentFilter = new IntentFilter(RefreshFolderOperation.EVENT_SINGLE_FOLDER_CONTENTS_SYNCED);
syncIntentFilter.addAction(RefreshFolderOperation.EVENT_SINGLE_FOLDER_SHARES_SYNCED);
mSyncBroadcastReceiver = new SyncBroadcastReceiver();
localBroadcastManager.registerReceiver(mSyncBroadcastReceiver, syncIntentFilter);
// Init Fragment without UI to retain AsyncTask across configuration changes
FragmentManager fm = getSupportFragmentManager();
TaskRetainerFragment taskRetainerFragment = (TaskRetainerFragment) fm.findFragmentByTag(TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT);
if (taskRetainerFragment == null) {
taskRetainerFragment = new TaskRetainerFragment();
fm.beginTransaction().add(taskRetainerFragment, TaskRetainerFragment.FTAG_TASK_RETAINER_FRAGMENT).commit();
}
// else, Fragment already created and retained across configuration change
}
use of androidx.fragment.app.FragmentManager in project android by nextcloud.
the class FileOperationsHelper method sendFiles.
public void sendFiles(Set<OCFile> files) {
// Show dialog
FragmentManager fm = fileActivity.getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(null);
SendFilesDialog sendFilesDialog = SendFilesDialog.newInstance(files);
sendFilesDialog.show(ft, "TAG_SEND_SHARE_DIALOG");
}
use of androidx.fragment.app.FragmentManager in project Signal-Android by signalapp.
the class MmsPreferencesActivity method onCreate.
@Override
protected void onCreate(Bundle icicle, boolean ready) {
assert getSupportActionBar() != null;
this.getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Fragment fragment = new MmsPreferencesFragment();
FragmentManager fragmentManager = getSupportFragmentManager();
FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
fragmentTransaction.replace(android.R.id.content, fragment);
fragmentTransaction.commit();
}
Aggregations