use of android.support.v4.app.FragmentManager in project android by owncloud.
the class AuthenticatorActivity method createAuthenticationDialog.
/**
* Create and show dialog for request authentication to the user
* @param webView Web view to embed into the authentication dialog.
* @param handler Object responsible for catching and recovering HTTP authentication fails.
*/
public void createAuthenticationDialog(WebView webView, HttpAuthHandler handler) {
// Show a dialog with the certificate info
CredentialsDialogFragment dialog = CredentialsDialogFragment.newInstanceForCredentials(webView, handler);
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
ft.addToBackStack(null);
dialog.setCancelable(false);
dialog.show(ft, CREDENTIALS_DIALOG_TAG);
if (!mIsFirstAuthAttempt) {
showSnackMessage(R.string.saml_authentication_wrong_pass);
} else {
mIsFirstAuthAttempt = false;
}
}
use of android.support.v4.app.FragmentManager in project android by owncloud.
the class FileActivity method showLoadingDialog.
/**
* Show loading dialog
*/
public void showLoadingDialog(int messageId) {
// grant that only one waiting dialog is shown
dismissLoadingDialog();
// Construct dialog
Fragment frag = getSupportFragmentManager().findFragmentByTag(DIALOG_WAIT_TAG);
if (frag == null) {
Log_OC.d(TAG, "show loading dialog");
LoadingDialog loading = LoadingDialog.newInstance(messageId, false);
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
loading.show(ft, DIALOG_WAIT_TAG);
fm.executePendingTransactions();
}
}
use of android.support.v4.app.FragmentManager in project android by owncloud.
the class LogHistoryActivity method showLoadingDialog.
/**
* Show loading dialog
*/
public void showLoadingDialog() {
// Construct dialog
LoadingDialog loading = LoadingDialog.newInstance(R.string.log_progress_dialog_text, false);
FragmentManager fm = getSupportFragmentManager();
FragmentTransaction ft = fm.beginTransaction();
loading.show(ft, DIALOG_WAIT_TAG);
}
use of android.support.v4.app.FragmentManager in project android by owncloud.
the class FileActivity method showUntrustedCertDialog.
/**
* Show untrusted cert dialog
*/
public void showUntrustedCertDialog(RemoteOperationResult result) {
// Show a dialog with the certificate info
FragmentManager fm = getSupportFragmentManager();
SslUntrustedCertDialog dialog = (SslUntrustedCertDialog) fm.findFragmentByTag(DIALOG_UNTRUSTED_CERT);
if (dialog == null) {
dialog = SslUntrustedCertDialog.newInstanceForFullSslError((CertificateCombinedException) result.getException());
FragmentTransaction ft = fm.beginTransaction();
dialog.show(ft, DIALOG_UNTRUSTED_CERT);
}
}
use of android.support.v4.app.FragmentManager in project android-support-v4-googlemaps by petedoyle.
the class FragmentStackSupport method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.fragment_stack);
// Watch for button clicks.
Button button = (Button) findViewById(R.id.new_fragment);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
addFragmentToStack();
}
});
button = (Button) findViewById(R.id.home);
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
// If there is a back stack, pop it all.
FragmentManager fm = getSupportFragmentManager();
if (fm.getBackStackEntryCount() > 0) {
fm.popBackStack(fm.getBackStackEntryAt(0).getId(), FragmentManager.POP_BACK_STACK_INCLUSIVE);
}
}
});
if (savedInstanceState == null) {
// Do first time initialization -- add initial fragment.
Fragment newFragment = CountingFragment.newInstance(mStackLevel);
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.simple_fragment, newFragment).commit();
} else {
mStackLevel = savedInstanceState.getInt("level");
}
}
Aggregations